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

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

[java] java.io.IOException: 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(ProcessBuilder.java:1128)
[java] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
[java] at java.base/java.lang.Runtime.exec(Runtime.java:589)
[java] at com.google.appinventor.buildserver.util.Execution.execute(Execution.java:111)
[java] at com.google.appinventor.buildserver.tasks.android.RunD8.runD8(RunD8.java:208)
[java] at com.google.appinventor.buildserver.tasks.android.RunD8.runD8(RunD8.java:157)
[java] at com.google.appinventor.buildserver.tasks.android.RunD8.execute(RunD8.java:129)
[java] at com.google.appinventor.buildserver.tasks.android.RunD8.execute(RunD8.java:30)
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[java] at com.google.appinventor.buildserver.Compiler.call(Compiler.java:169)
[java] at com.google.appinventor.buildserver.Compiler.call(Compiler.java:33)
[java] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[java] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[java] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[java] at java.base/java.lang.Thread.run(Thread.java:834)
[java] Caused by: java.io.IOException: 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.(ProcessImpl.java:492)
[java] at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:153)
[java] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
[java] ... 17 more
[java]
[java] ←[31m[←[35mRunD8←[0m←[31m] ERROR: d8 failed.←[0m
[java] ←[31m[←[35mRunD8←[0m←[31m] Task errored in ←[35m86.859←[31m seconds←[0m

BUILD FAILED

Full Logs.txt (785.1 KB)

@moderators @admins

anyone please help me in this issues?

well, what about using another directory?
Taifun

What did you mean?

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

Taifun

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