使用OSX中的ANT构建Android应用程序会导致NullPointerException

时间:2012-08-13 18:35:04

标签: android macos ant build jenkins

我运行以下命令(它是一个lib项目..但我也在常规项目中得到这个):

android update lib-project -t "android-16" -p whatever_my_project_is
ant clean debug -v -d -f "${WORKSPACE}/whatever_my_project_is/build.xml"

它开始正常构建项目中的各个类,但是然后BOOM这个nullpointerexception在R.java期间发生

 /Users/Shared/Jenkins/Home/jobs/Androidyaddayadda 1/workspace/whatever_my_project_is/yadda/yadda/R.java
    [javac] An exception has occurred in the compiler (1.6.0_33). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
    [javac] java.lang.NullPointerException
    [javac]     at com.sun.tools.javac.comp.Check.checkCompatibleConcretes(Check.java:1213)
    [javac]     at com.sun.tools.javac.comp.Check.checkCompatibleSupertypes(Check.java:1565)
    [javac]     at com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:2674)
    [javac]     at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2628)
    [javac]     at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2584)
    [javac]     at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:2564)
    [javac]     at com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1045)
    [javac]     at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:768)
    [javac]     at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:730)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:353)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:279)
    [javac]     at com.sun.tools.javac.main.Main.compile(Main.java:270)
    [javac]     at com.sun.tools.javac.Main.compile(Main.java:69)
    [javac]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javac]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]     at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]     at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
    [javac]     at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1134)
    [javac]     at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912)
    [javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    [javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]     at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    [javac]     at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
    [javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    [javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]     at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac]     at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    [javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    [javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]     at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac]     at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
    [javac]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    [javac]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [javac]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [javac]     at java.lang.reflect.Method.invoke(Method.java:597)
    [javac]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [javac]     at org.apache.tools.ant.Task.perform(Task.java:348)
    [javac]     at org.apache.tools.ant.Target.execute(Target.java:390)
    [javac]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
    [javac]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    [javac]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    [javac]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    [javac]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    [javac]     at org.apache.tools.ant.Main.runBuild(Main.java:809)
    [javac]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
    [javac]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    [javac]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

有没有人知道在OSX上使用Ant构建Android的解决方法?我正在使用Jenkins ..但是命令通过bash为我做了同样的事情。

谢谢

1 个答案:

答案 0 :(得分:0)

This seems to be a bug in java

根据Bug报告,这应该在Java 1.7中修复,但不能在1.6或1.5中修复。