We have an ANT build process that builds all of our android projects at once. It is completely based on the build process encouraged by android.
We switched to ADT20 and the build process now fails when we are building a release. The android build process fails when trying to handle “Ordered Dependencies” during the -build-setup.
We sign our release applications with an ant.properties file that contains the key.store, key.alias, key.store.password and key.alias.password.
It fails with the following error:
C:\PATH\android-sdks\tools\ant\build.xml:546: java.lang.NullPointerException
That is all it says without the -debug flag.
With the -debug flag i am getting this:
C:\PATH\android-sdks\tools\ant\build.xml:546: java.lang.NullPointerException
at org.apache.tools.ant.taskdefs.Exit.execute(Exit.java:164)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at net.sf.antcontrib.logic.TryCatchTask$CatchBlock.execute(TryCatchTask.java:137)
at net.sf.antcontrib.logic.TryCatchTask.execute(TryCatchTask.java:225)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
To solve this issue i put the properties in a specific order:
key.storekey.aliaskey.store.passwordkey.alias.passwordAnd i took out all extra white space at the bottom of the
ant.propertiesfile.This was working fine in the older versions of
ADT. Not sure what changed to make it fail.But re-ordering the properties and removing the white spaces fixed the problem.
I hope this helps someone else in the future, because i spent 10 hours trying to track
this issue down. It would have helped if there were better error details from
ANT.I used this little bit of
ANTcode to make sure white space was gone.