🏃‍♂️ Fast : An Efficient Way to Build Extensions

I don't know, but I am facing issues in this type error.
And reset c drive in 2-3 times and but not successful build.
And last time windows installation change lagacy mode in c drive.
Then proper working and build successful.

Fast doesn't support java 17?

Yes, it should be compatible with JDK 17 and later versions. However, the desugaring feature is only supported by JDK 8 and 11. If you don't require the desugaring feature, you could use it with any JDK version (JDK 8 or higher).

I thought so too, but:

Fast is initialized.
FAST Version: 2.3.1 17.01.25.19.41
JRE Version: 17.0.14
JRE Specification: 17
JRE Home: C:\Program Files\OpenLogic\jdk-17.0.14.7-hotspot
OS Name: Windows 11
OS Version: 10.0
Architecture: amd64
Username: Patryk
User Home: C:\Users\Patryk
Working Directory: C:\Users\Patryk\FastProjects\test17
Path Separator: ;
File Separator: \
Line Separator: 

fast build initialized.
-d passed as an argument to show the debug info to the terminal.
PROJECT_DIR: C:\Users\Patryk\FastProjects\test17
fast.yml is found at: C:\Users\Patryk\FastProjects\test17\fast.yml
Got the JAVA_HOME from environment variable.
JAVA_HOME: C:\Program Files\OpenLogic\jdk-17.0.14.7-hotspot\
Got FAST_HOME from environment variable.
FAST_HOME: C:\Users\Patryk\AppData\Local\Fast
KOTLIN_HOME: C:\Users\Patryk\AppData\Local\Fast\lib\compiler\1.9.24\kotlinc
Kotlin compiler is not exists!
AndroidManifest.xml is found at: C:\Users\Patryk\FastProjects\test17\src\AndroidManifest.xml
Package name is: pl.patryk_f.test17
Cleaning build caches.
Checking the availablity of .kt files.
Checking the availablity of .java file.
Getting provided libraries.
Got 86 libraries.
Getting the libraries of deps folder.
Got 8 libraries.
Increasing components version.
Compiling java classes.
Found 2 sources.
Added custom bootclasspath to target Java 8.
Successfully created javac arguments
Calling javac commands.
Note: Wrote file file:///C:/Users/Patryk/FastProjects/server-http/.fast/classes/simple_components.json
Note: Wrote file file:///C:/Users/Patryk/FastProjects/server-http/.fast/classes/simple_components.txt
Note: Wrote file file:///C:/Users/Patryk/FastProjects/server-http/.fast/classes/simple_components_build_info.json
Note: Wrote file file:///C:/Users/Patryk/FastProjects/server-http/.fast/classes/AutogeneratedOdeMessages.java
Note: Wrote file file:///C:/Users/Patryk/FastProjects/server-http/.fast/classes/ComponentsTranslation.java
javac is successfully executed.
Making raw files.
Coping assets.
Created aiwebres dir at raw.
Reading AndroidManifest.xml
Packaging compiled classes.
Re-arrange the blocks in order to source.
Removing annotations from sources.
Unjaring dependencies.
Merging dependencies into a single jar.
Generating AndroidRuntime.jar
Merging the libraries.jar to the AndroidRuntime.jar
Merging compiled sources and required deps.
Will run the proguard task if -r passed.
Moving the runtime jar to the desired dir of raw..
Running the dexing task.
Generating DEX bytecode.
Successfully created dexing arguments
Calling dexing commands.
Compilation failed with an internal error.
java.lang.IllegalArgumentException: Unsupported class file major version 61
	at com.android.tools.r8.A.a.a.f.<init>(:10)
	at com.android.tools.r8.A.a.a.f.<init>(:2)
	at com.android.tools.r8.A.a.a.f.<init>(:1)
	at com.android.tools.r8.A.a.a.f.<init>(:107)
	at com.android.tools.r8.graph.x0.a(:24)
	at com.android.tools.r8.dex.a$a.a(:12)
	at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
D8 is failed to execute!
java.io.IOException: BUILD FAILED!
	at com.jewel.fast.repacked.eZPTmfaCfALvrvtDyTfP.<init>(D8Dexer.java:78)
	at com.jewel.fast.repacked.NtYtbwyrLKtbUfQajvtn.<init>(Build.java:39602)
	at com.jewel.fast.Fast.main(Fast.java:58)

All 3 desugaring options are set to false.

Could you try with a different version of d8 jar?

It worked with d8 that I extracted from Android Studio. But app inventor doesn't compile apk, so I guess we can't use libraries compiled in java17.

Yeah, you're probably right. Plus, we might not be able to write code in Java 17.

Hi Jewel,

I am having build fail issue when using library that uses Kotlin and Android x and when compiling with

# If enabled, you will be able to use Java 8 language features in your extension source code.
desugar_sources: true
# Enable it, if any of your dependencies use Java 8 language features.
desugar_deps: true
# If enabled, the D8 tool will generate desugared jar (classes.dex)
desugar_dex: true

Error log:

- Cleaning build caches
- Resolving runtime dependencies
  - Searching for required dependencies
  - Resolving required dependencies
- Compiling Kotlin classes
- Generating components info
- Coping extension assets
- Reading AndroidManifest.xml
- Generating docs in Markdown
- Desugaring Java 8 langauge features
- Merging dependencies into a single jar
- Desugaring dependencies
  - Exception in thread "main" java.lang.NoClassDefFoundError: androidx/lifecycle/LifecycleCoroutineScope
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethods(Unknown Source)
        at com.google.devtools.build.android.desugar.LambdaDesugaring.findTargetMethod(LambdaDesugaring.java:335)
        at com.google.devtools.build.android.desugar.LambdaDesugaring.queueUpBridgeMethodIfNeeded(LambdaDesugaring.java:244)
        at com.google.devtools.build.android.desugar.LambdaDesugaring.access$200(LambdaDesugaring.java:61)
        at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:429)
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:462)
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:462)
        at com.google.devtools.build.android.desugar.strconcat.IndyStringConcatDesugaring$IndifiedStringConcatInvocationConverter.visitInvokeDynamicInsn(IndyStringConcatDesugaring.java:141)   
        at org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn(MethodVisitor.java:462)
        at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2451)
        at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1491)
        at org.objectweb.asm.ClassReader.accept(ClassReader.java:721)
        at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:549)
        at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:326)
        at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:246)
        at com.google.devtools.build.android.desugar.Desugar.processRequest(Desugar.java:1026)
        at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:968)
  - Caused by: java.lang.ClassNotFoundException: Class androidx.lifecycle.LifecycleCoroutineScope not found
        at com.google.devtools.build.android.desugar.io.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 19 more
x java.io.IOException: BUILD FAILED!
        at com.jewel.fast.repacked.gbGgTCqDDFhxZQzomtgL.<init>(Desugarer.java:131)
        at com.jewel.fast.repacked.NtYtbwyrLKtbUfQajvtn.<init>(Build.java:28532)
        at com.jewel.fast.Fast.main(Fast.java:58)

Please make sure that this class is present as compile/runtime. Or you may just ignore desugaring, I believe at this moment this is not more needed.

I tried syncing all required dependencies still getting same issue.

Its required as the library I am using uses Java 8 language features.

AppInventor supports java11, desugaring is no longer necessary. Android supports java8 somehow since api 24. But if the library you are using uses a missing class somewhere, the compiled application will still throw an error at some point.

2 Likes

Please confirm the presence of the missing class. I recommend adding the library as a local JAR file, ensuring the missing class is included within that JAR.

It's not that simple. Because it's a Lifecycle library that's used by appinventor. The class that's missing was added in version 2.2. If we want to add Lifecycle 2.2, we need to add all androidx libraries and use proguard to repack androidx classes so they don't conflict with those added by appinventor.

1 Like

I did as the installation wiki (installed manually)
run fast create, fast build, but got this error:
the Chinese in the picture says 'package not exist'

java -version
image

Somehow, FAST is unable to add AI2 provided libraries to Java Compiler as classpath. Could you please upload the logs.txt here or in PM?

logs.txt (2.9 KB)

AI2 provided libraries are not present at: C:\Users\Administrator\AppData\Local\Fast\lib\appinventor

Thanks. Solved by copying /Fast/lib/ to C:\Users\Administrator\AppData\Local\Fast\lib\

Please add this instruction to the wiki installed manually part.

1 Like

Sure and thanks for your suggestion. However, I'm planning to share a tutorial video about how to install the FAST manually on Windows.

I checked the aar version of library file in zip viewer, the library does contains the required classes but issue seems to be with FAST when the library uses androidx classes the build fails.

It also conflicts when importing the dependencies.