Ant Not Building Appinventor

I have done everything given HERE and the slideshow but while building i get this

error
 [java] 192. ERROR in C:\Users\techa\AppData\Local\Temp\1618207380004_0.4715318877939759-0\build\generated\src\org\osmdroid\library\R.java (at line 44)
 [java]     public static final class string {
 [java]                               ^^^^^^
 [java] Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
 [java] ----------
 [java] 192 problems (192 errors)
 [java] javac returned error code 1

BUILD FAILED
E:\appinventor-sources\appinventor\build.xml:21: The following error occurred while executing this line:
E:\appinventor-sources\appinventor\buildserver\build.xml:196: Java returned: 1

Total time: 45 seconds

Error code is bigger than this but cant paste full due to word limit

Please Help @ewpatton

Any Help Will be appreciated
Akshat

Hello @AkshatRana, it looks like you are using java 9 or higher, the Appinventor source is only configured to run in java 8, running on a heigher java version would result in failure to compile the sources, See this answer here:

But when i try to check my java version it shows nothing..

image

What about runningjavac -version?
Also, what version of the java JDK do you use?

Again same
image

I have

In cmd type echo %JAVA_HOME%

It gives this
image

In windows 10 from control panel go Advanced System Settings and then in the window that pops choose Environment Variables. In System Variables check if in PATH variable you have %JAVA_HOME%\bin if not add it

image

Already Added
image

Now run again javac -version

Still same result
image

Also in System Variables do you have a variable JAVA_HOME ? See if variable value is set to path C:\Program Files\Java\jdk1.8.0_281

1 Like

yes i have
image

I tried to reinstall my App Inventor Sources And While Bulding Ant i got this

[java] Invoking Linker Cross-Site-Iframe
[java] [ERROR] Failed to link
[java] java.lang.OutOfMemoryError: Java heap space
[java] at java.util.Arrays.copyOf(Arrays.java:3332)
[java] at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
[java] at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
[java] at java.lang.StringBuilder.append(StringBuilder.java:136)
[java] at com.google.gwt.core.linker.CrossSiteIframeLinker.wrapPrimaryFragment(CrossSiteIframeLinker.java:700)
[java] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generatePrimaryFragmentString(SelectionScriptLinker.java:411)
[java] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generatePrimaryFragment(SelectionScriptLinker.java:386)
[java] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.doEmitCompilation(SelectionScriptLinker.java:254)
[java] at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.link(SelectionScriptLinker.java:196)
[java] at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.invokeLinkForOnePermutation(StandardLinkerContext.java:384)
[java] at com.google.gwt.dev.Link.finishPermutation(Link.java:483)
[java] at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:445)
[java] at com.google.gwt.dev.Link.link(Link.java:178)
[java] at com.google.gwt.dev.Compiler.compile(Compiler.java:244)
[java] at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[java] at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[java] at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[java] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[java] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[java] at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[java] [ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

BUILD FAILED
E:\appinventor-sources\appinventor\build.xml:16: The following error occurred while executing this line:
E:\appinventor-sources\appinventor\appengine\build.xml:581: Java returned: 1

Total time: 7 minutes 40 seconds

PS >- My Laptop Has 8gb ram

Hi @AkshatRana you can try completely uninstalling java and re-install java 8
I also had this problem a while ago but it was solved after I reinstalled java.
I problem was it was tracking the Program File/common files/

configuration file

but as the config file was meant for java 15 so it did not scho any thing so after I reinstalled it changed the config file too

Hope this helps :slight_smile:

2 Likes

I had tried but getting the same error.

Please Help @ewpatton

@AkshatRana It did not work after re-installing too ?

It had build successfully when i change my _JAVA_OPTIONS from 1024M to 2048M

Ok so run go to the /appinventor folder
and run

java_dev_appserver --port=8888 --address=0.0.0.0 appengine/build/war/
you will find your appinventor running on localhost:8888

Its saying
This action requires the installation of components: [app-engine-java]