diff options
4 files changed, 21 insertions, 3 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java index 7a169f3..9ceba20 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java @@ -12,6 +12,8 @@ public class Messages extends NLS { public static String AAPT_Exec_Error_d; + public static String AAPT_Exec_Error_Other_s; + public static String Added_s_s_Needs_Updating; public static String AIDL_Exec_Error_s; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties index 70a3ab2..f387ab5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties @@ -14,6 +14,7 @@ Unparsed_AAPT_Errors=Unparsed aapt error(s)\! Check the console for output. Unparsed_AIDL_Errors=Unparsed aidl error\! Check the console for output. AAPT_Exec_Error_s=Error executing aapt. Please check aapt is present at %1$s AAPT_Exec_Error_d=Error executing aapt: Return code %1$d +AAPT_Exec_Error_Other_s=Error executing aapt: %1$s Dalvik_Error_d=Conversion to Dalvik format failed with error %1$d DX_Jar_Error=Dx.jar is not found inside the plugin. Reinstall ADT\! Dalvik_Error_s=Conversion to Dalvik format failed: %1$s diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java index a55e840..2e66295 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java @@ -1127,7 +1127,18 @@ public class PreCompilerBuilder extends BaseBuilder { } catch (IOException e1) { // something happen while executing the process, // mark the project and exit - String msg = String.format(Messages.AAPT_Exec_Error_s, array.get(0)); + String msg; + String path = array.get(0); + if (!new File(path).exists()) { + msg = String.format(Messages.AAPT_Exec_Error_s, path); + } else { + String description = e1.getLocalizedMessage(); + if (e1.getCause() != null && e1.getCause() != e1) { + description = description + ": " + e1.getCause().getLocalizedMessage(); + } + msg = String.format(Messages.AAPT_Exec_Error_Other_s, description); + } + markProject(AdtConstants.MARKER_ADT, msg, IMarker.SEVERITY_ERROR); // Add workaround for the Linux problem described here: diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java index 9c20081..3be729e 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java @@ -65,8 +65,10 @@ public class SymbolLoader { mSymbols = HashBasedTable.create(); + String currentLine = ""; try { for (String line : lines) { + currentLine = line; // format is "<type> <class> <name> <value>" // don't want to split on space as value could contain spaces. int pos = line.indexOf(' '); @@ -79,8 +81,10 @@ public class SymbolLoader { mSymbols.put(className, name, new SymbolEntry(name, type, value)); } - } catch (ArrayIndexOutOfBoundsException e) { - throw new IOException("File format error reading " + mSymbolFile.getAbsolutePath()); + } catch (Exception e) { + // Catch both ArrayIndexOutOfBoundsException and StringIndexOutOfBoundsException + throw new IOException("File format error reading " + mSymbolFile.getAbsolutePath() + + ": " + currentLine, e); } } |