Failed Compilation at org.apache.tools.ant.ProjectHelper.addLocationToBuildException

Dear all,

I tried to build the current App Inventor source on my Linux machine (Debian 10 Buster x86_64, JDK 13), but failed. The compilation seems to stops at the generated resources of osmdroid and aicompanion3. The full log is attached in the link, with part of the log records below. Is there any clue I can go on? Many thanks to you in advance.

imacat@cocoa appinventor-sources/appinventor % ant -v
Apache Ant™ version 1.10.5 compiled on August 27 2018
Trying the default build file: build.xml
Buildfile: /home/imacat/appinventor-sources/appinventor/build.xml
Detected Java version: 13 in: /usr/lib/jvm/jdk-13.0.2
Detected OS: Linux

[java] Generated 497 files
[java] Included 0 files from jar/zip files.
[java] Checking for deleted files
[java] Done!
[java] Annotation processing got disabled, since it requires a 1.6 compliant JVM
[java] ----------
[java] 1. ERROR in /tmp/1588835901434_0.9799039920356735-0/build/generated/src/org/osmdroid/library/R.java (at line 1)
[java] /* AUTO-GENERATED FILE. DO NOT MODIFY.
[java] ^
[java] The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
[java] ----------
[java] 2. ERROR in /tmp/1588835901434_0.9799039920356735-0/build/generated/src/org/osmdroid/library/R.java (at line 9)
[java] public final class R {
[java] ^
[java] Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
[java] ----------
[java] 3. ERROR in /tmp/1588835901434_0.9799039920356735-0/build/generated/src/org/osmdroid/library/R.java (at line 10)
[java] public static final class drawable {
[java] ^^^^^^^^
[java] Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
[java] ----------

[java] ^
[java] Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
[java] ----------
[java] 191 problems (191 errors)
[java] javac returned error code 1
[ant] Exiting /home/imacat/appinventor-sources/appinventor/buildserver/build.xml.

BUILD FAILED
/home/imacat/appinventor-sources/appinventor/build.xml:21: The following error occurred while executing this line:
/home/imacat/appinventor-sources/appinventor/buildserver/build.xml:189: Java returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:566)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
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:834)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

App Inventor needs to be built with Java 8. The information in your log suggests that you are building with Java 13. You should install openjdk 8 and set your JAVA_HOME variable accordingly, or use update-alternatives to set the default java/javac paths to point to openjdk 8.

1 Like

OK. It works now. Thank you very much. :slight_smile: