CreateProcess error=206, The filename or extension is too long

I faced an error while compiling our companion application using Java 11

[java] Cannot run program "java" (in directory "C:\Users\Admin\AppData\Local\Temp\1707421025691_0.49786761528791057-0\youngandroidproject..\build\tmp"): CreateProcess error=206, The filename or extension is too long
[java] at java.base/java.lang.ProcessBuilder.start(
[java] at java.base/java.lang.ProcessBuilder.start(
[java] at java.base/java.lang.Runtime.exec(
[java] at
[java] at
[java] at
[java] at
[java] at
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
[java] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
[java] at java.base/java.lang.reflect.Method.invoke(
[java] at
[java] at
[java] at java.base/
[java] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
[java] at java.base/java.util.concurrent.ThreadPoolExecutor$
[java] at java.base/
[java] Caused by: CreateProcess error=206, The filename or extension is too long
[java] at java.base/java.lang.ProcessImpl.create(Native Method)
[java] at java.base/java.lang.ProcessImpl.(
[java] at java.base/java.lang.ProcessImpl.start(
[java] at java.base/java.lang.ProcessBuilder.start(
[java] ... 17 more
[java] ←[31m[←[35mRunD8←[0m←[31m] ERROR: d8 failed.←[0m
[java] ←[31m[←[35mRunD8←[0m←[31m] Task errored in ←[35m86.859←[31m seconds←[0m


Full Logs.txt (785.1 KB)

@moderators @admins

anyone please help me in this issues?

well, what about using another directory?

What did you mean?

Which directory did you use for the App Inventor sources? Use a simple and short directory like C:\AppInventor


The directory you mentioned on the topic is the Temp directory for companion and local application builds.

and my real directory is C:/Users/admin/appinventor-sources/appinventor

Have you done any changes to the companion before starting the compile procedure? Stating that information would help.

No! I just forked the source from Mit, and my PC has preinstalled Java 11. Then I do all the processes, and then I ran Ant PlayApp.

But in Java 1_8, the buildserver and companion app are building, but using Java 11, it's giving me an error.

It's better to stick with Java 1.8, until the Java 11 is stable.

But Java 1.8 is using dx to build applications, so some libraries are not accepting dx to compile.

@ewpatton Sir, please look into this issue.

Which version of Windows are you running?

Window 10

@ewpatton please look here

@ewpatton Sir, please reply here too

I've created a branch with a possible fix. Please check it out and let me know if it resolves the error.

Con estos cambios las aplicaciones .apk se crean correctamente pero la compilación del archivo .aab falla.

Lo probé con un HelloPurr

I have pushed another update that should fix the AAB issue.

[RunD8] ERROR: C:\Users\LENOVO\appinventor-sources\appinventor\build\buildserver\dexCache\classes.dex

New issues spotted @ewpatton sir