aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-09-27 09:01:50 -0700
committerTor Norbye <tnorbye@google.com>2012-09-27 09:01:50 -0700
commitbd54479ad895f373065333dbc450229664b232eb (patch)
tree9b16a722471822cabf1e8d586ae3c8f10aa24b48 /sdkmanager
parent3c5badce945d4c2af761e1877af197beefe0443c (diff)
downloadsdk-bd54479ad895f373065333dbc450229664b232eb.zip
sdk-bd54479ad895f373065333dbc450229664b232eb.tar.gz
sdk-bd54479ad895f373065333dbc450229664b232eb.tar.bz2
Improve aapt error message
If anything goes wrong with aapt, we emit an error message that we could not execute aapt and to check the install location. However, if the file exists but isn't executable, or if a parsing error happens in the new SymbolLoader/Writer, the error message is misleading. This changeset makes the error message more specific if it looks like the root cause isn't a missing aapt installation. Change-Id: Ifb09a2dd736f6a93c0f167162826e1ad6e3d2a63
Diffstat (limited to 'sdkmanager')
-rw-r--r--sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java8
1 files changed, 6 insertions, 2 deletions
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);
}
}