BlocklyCompile Errors Prevent Successly Building App Inventor

Here is what the terminal spits out after running the command ant:
buildlog.txt (36.7 KB)

I haven't made any changes to the source, the goal is to try to build App Inventor and run it locally on my machine, which makes this build failing even more confusing because it's not like there is a syntax error or something in the code.

I did run the command git submodule update --init before building.

I also ran buildtools doctor before building and it returned:

Diagnosing your system...

[PASS] Java is installed.
[PASS] Required version of Java is installed.
[PASS] Git is installed.
[PASS] Git submodules are properly set up.
[PASS] Google Cloud SDK is installed.

Passed 5 checks and 0 failing

The fact that I get a pass on Git submodules are properly set up. is what is tripping me up because that would mean Blockly is correctly set up on my machine. If that's the case, why is BlocklyCompile running into errors?

(This is also in the attached text file, located at the bottom, this is part of the file that I'd like to focus on)

     [java] Exception in thread "main" java.lang.ExceptionInInitializerError
     [java]     at org.plovr.cli.BuildCommand.runCommandWithOptions(
     [java]     at org.plovr.cli.BuildCommand.runCommandWithOptions(
     [java]     at org.plovr.cli.AbstractCommandRunner.runCommand(
     [java]     at org.plovr.cli.Command.execute(
     [java]     at org.plovr.cli.Main.mainWithExitCode(
     [java]     at org.plovr.cli.Main.main(
     [java] Caused by:$ComputationException: java.lang.ExceptionInInitializerError
     [java]     at$MapMaker$StrategyImpl.compute(
     [java]     at$MapMaker$StrategyImpl.compute(
     [java]     at$CustomConcurrentHashMap$ComputingImpl.get(
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at$Processor$
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at$Builder.<init>(
     [java]     at$Builder.<init>(
     [java]     at org.plovr.CompileRequestHandler.<clinit>(
     [java]     ... 6 more
     [java] Caused by: java.lang.ExceptionInInitializerError
     [java]     at$FastClassEmitter.<init>(
     [java]     at$FastClass$Generator.generateClass(
     [java]     at$DefaultGeneratorStrategy.generate(
     [java]     at$AbstractClassGenerator.create(
     [java]     at$FastClass$Generator.create(
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at$000(
     [java]     at$1.create(
     [java]     at$1.create(
     [java]     at$1.apply(
     [java]     at$MapMaker$StrategyImpl.compute(
     [java]     ... 23 more
     [java] Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int, throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @762efe5d
     [java]     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(
     [java]     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(
     [java]     at java.base/java.lang.reflect.Method.checkCanSetAccessible(
     [java]     at java.base/java.lang.reflect.Method.setAccessible(
     [java]     at$ReflectUtils$
     [java]     at java.base/
     [java]     at$ReflectUtils.<clinit>(
     [java]     ... 37 more

C:\Users\Current User\Documents\MIT App Inventor\appinventor-sources\appinventor\build.xml:16: The following error occurred while executing this line:
C:\Users\Current User\Documents\MIT App Inventor\appinventor-sources\appinventor\build-common.xml:299: The following error occurred while executing this line:
C:\Users\Current User\Documents\MIT App Inventor\appinventor-sources\appinventor\blocklyeditor\build.xml:120: Java returned: 1

java -version:

openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-39)
OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)

ant -version:

Apache Ant(TM) version 1.10.12 compiled on October 13 2021

1 Like

add app inventor sources folder in exclusion or turn off your antivirus

I already tried and it still doesn't build

@karlv350 sir, is this a fresh copy of appinventor-sources or did you make any edits
if yes(if you made edits), then did you change anything related to Blockly?

I think its not a java or ant problem...

@karlv350 do you have Python Installed?

P.S: This too could be a reason:

The space between Current User and in the MIT App Inventor DIRs may cause the problem, but I think this PR solved that issue :thinking:

Yes, it's a fresh fork of the original source. I have not tampered anything. I mentioned this in the original post.

Yes I have Python 3.10.0 already installed.

I highly doubt the spaces are causing any trouble because other components of App Inventor are able to build just fine. I can investigate this though.

1 Like

Sir did you fork and download it or clone is locally using this command - git clone
because that too may cause any problem...

I cloned my fork

1 Like

Run git pull origin master in appinventor-sources folder

Can you elaborate why we should use it and what does that command does?

Hello @karlv350,
Appinventor is designed to build and run on Java 8, using a later java version could cause multiple errors in different parts of the sources.

The output of the java -version command you posted indicates you have Java 17 installed, please try to downgrade to java 8, restart the terminal, and try again to build the sources.

Note: Spaces in the path of the Appinventor clone should cause no problems if the fork is using the latest Appinventor sources.


@karlv350 as I see in your main post you have installed java 17.0.1 instead of java 1.8.x

App inventor is complied with java 1.8.x

You can also see this in the README file of the project ...

(Last line of the introduction section.)

It means if the master branch was updated with the new features then you need to pull the code from remote repository to local repository otherwise you could not be able to access new features of the app inventor.


I'll try to compile using Java 8. Is there a preference between OpenJDK and Oracle though? Would a JDK from either work fine, as long as it's Java 8? Also, if you don't mind, can you post a link to a Java 8 JDK download. This might be a case of me just being bad at googling things, but the reason why I used the latest Java version from OpenJDK is because I couldn't find specifically version Java 8 on their website

1 Like

No, both should work fine with appinventor, as long as they are java 8.

@dora_paz has posted the link for Oracle's JDK. you can also find OpenJDK's downloads from here:
Latest release | AdoptOpenJDK - Open source, prebuilt OpenJDK binaries


Yup, I guess my Java version was messing things up. I used OpenJDK's Java 8 JDK and successfully compiled the entire project. Seeing that BUILD SUCCESSFUL message after 3 minutes of compiling was so relieving, haha. Thank you guys for the help!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.