Previously, I made some changes to the compilation process to be compatible with older devices (ex. Windows 7). Also, these changes were required for the D8 tool.
However, I'm planning to add the R8 tool as an optional task in experimental mode. FAST will use R8 instead of ProGuard if you enable R8 from fast.yml. This may be helpful for smaller extension projects.
If youβre using ProGuard, so just you need to add -dontwarn option for those enum classes when you're sure that these classes are not required on runtime.
The R8 will utilize the same proguard-rules.pro file. However, this time, I have simplified it to ensure compatibility with R8. Since R8 is an experimental tool, it may encounter unexpected exceptions. One common issue is that the ProGuard tool can handle classes missing issues, while R8 cannot. In such cases, R8 throws a classes missing exception.
To avoid unintentional compilation.
Thank you for your ongoing feedback to improve the FAST.
These warnings appear during source compilation, before desugaring and proguard. They even appear before warnings about missing descriptions in appinventor methods.
I tried R8 but it stops, some class or method is missing? :
Generating DEX bytecode.
Running the dexing task.
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/raise$Mnobject$Mnexception.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/srfi34
innerTypeInternal: gnu/kawa/slib/raise$Mnobject$Mnexception
innerName: Mnexception
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/srfi34.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/srfi34
innerTypeInternal: gnu/kawa/slib/raise$Mnobject$Mnexception
innerName: Mnexception
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/test$Mnrunner.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/testing
innerTypeInternal: gnu/kawa/slib/test$Mnrunner
innerName: Mnrunner
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/conditions.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/conditions
innerTypeInternal: gnu/kawa/slib/condition$Mntype
innerName: Mntype
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/testing.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/testing
innerTypeInternal: gnu/kawa/slib/test$Mnrunner
innerName: Mnrunner
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/conditions$frame.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/conditions
innerTypeInternal: gnu/kawa/slib/condition$Mntype
innerName: Mntype
Info in C:\Users\Patryk\AppData\Local\Fast\lib\appinventor\kawa.jar:gnu/kawa/slib/condition$Mntype.class:
Malformed inner-class attribute:
outerTypeInternal: gnu/kawa/slib/conditions
innerTypeInternal: gnu/kawa/slib/condition$Mntype
innerName: Mntype
Error: java.lang.NoSuchMethodError: java.util.function.Predicate.not(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
Compilation failed with an internal error.
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:98)
at com.android.tools.r8.R8.main(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
at Version.fakeStackEntry(Version_4.0.63.java:0)
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:75)
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:28)
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:27)
at com.android.tools.r8.R8.b(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:44)
at com.android.tools.r8.R8.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:1374)
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:85)
... 1 more
Caused by: java.lang.NoSuchMethodError: java.util.function.Predicate.not(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
at com.android.tools.r8.internal.bb.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:57)
at com.android.tools.r8.internal.bb.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:18)
at com.android.tools.r8.internal.c5.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:4)
at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
at com.android.tools.r8.internal.c5.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:3)
at com.android.tools.r8.internal.bb.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:10)
at com.android.tools.r8.internal.hb.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:72)
at com.android.tools.r8.internal.hb.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:104)
at com.android.tools.r8.internal.no.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:59)
at com.android.tools.r8.internal.no.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:12)
at com.android.tools.r8.R8.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:338)
at com.android.tools.r8.R8.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:1373)
at com.android.tools.r8.internal.vk.a(R8_4.0.63_60b6673af9aedf212724e0f5aa211c43280952408a124d03f2973a80bb67dd6b:24)
... 4 more
R8 dexer is failed to execute!
java.io.IOException: BUILD FAILED!
java.io.IOException: BUILD FAILED!
at com.jewel.fast.repacked.AgFAKoeZezlMezLLFxcBWVyUsQBaxKDDxvThNDeIOeWETzTLCucNgOJWFpHgBlHx.<init>(Unknown Source)
at com.jewel.fast.repacked.mRKaQanqzAAYCvMgIoKmGzubeaQpFMJPGnravThpWtntqpXyRrwWWCZLaviTLSPv.<init>(Unknown Source)
at com.jewel.fast.Fast.main(Unknown Source)
Warning: library class com.google.api.client.json.gson.GsonGenerator depends on program class com.google.gson.stream.JsonWriter
Warning: library class com.google.api.client.json.gson.GsonParser depends on program class com.google.gson.stream.JsonReader
Adding the google-http-client-gson.jar library fixed the problem, but it didn't happen before.
Does proguard use guava library, does it have it built in? I add guava to extension, removed older versions from Fast folder and did sync. But it seems that proguard still sees older guava version than 33 somewhere, because I have many warnings and I have to use -dontwarn for guava classes. Here are some of them:
Warning: library class com.google.common.util.concurrent.ImmediateFuture$ImmediateFailedCheckedFuture extends or implements program class com.google.common.util.concurrent.ImmediateFuture
Warning: library class com.google.common.util.concurrent.ImmediateFuture$ImmediateSuccessfulCheckedFuture extends or implements program class com.google.common.util.concurrent.ImmediateFuture
Warning: library class com.google.common.util.concurrent.ImmediateFuture$ImmediateSuccessfulFuture extends or implements program class com.google.common.util.concurrent.ImmediateFuture
Warning: library class com.google.common.util.concurrent.Service$State$1 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Service$State$2 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Service$State$3 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Service$State$4 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Service$State$5 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Service$State$6 extends or implements program class com.google.common.util.concurrent.Service$State
Warning: library class com.google.common.util.concurrent.Striped$2 extends or implements program class com.google.common.base.Supplier
Warning: library class com.google.common.util.concurrent.Striped$3 extends or implements program class com.google.common.base.Supplier
Warning: library class com.google.common.util.concurrent.Striped$4 extends or implements program class com.google.common.base.Supplier
Warning: library class com.google.common.util.concurrent.Striped$5 extends or implements program class com.google.common.base.Supplier
Warning: library class com.google.common.util.concurrent.Striped$6 extends or implements program class com.google.common.base.Supplier
Class e.g. com.google.common.util.concurrent.Striped$2 does not appear in my version of guava. But it is in guava 27.1 which appinventor uses. But it is present in guava 27.1 which is used by appinventor. But it is nowhere in Fast folders or in my dependencies.
I see that proguard has inside jar guave, gson and many other libraries. Probably in older version than I use in extension and that's where problem is. I don't know if -dontwarn will be safe in this case?
The dontwarn option can be safely used to suppress duplicate class warnings. However, when encountering classes missing issues, it is crucial to ensure that the required classes are present in the dependencies folder. Alternatively, it is necessary to verify that the absence of these classes will not adversely affect runtime behavior.
I've started coding for it and hopefully I'll be able to release it with the next update.
Yes, of course. Only the warnings I showed are not due to missing classes, because my dependencies have those classes...the reason is that proguard has built-in outdated libraries that do not have the appropriate classes.
hello @JEWEL , i got error while i am using fast build command
error:
- Error parsing command line: While parsing option --classpath_entry C:\Program: C:\Program is not a valid path: it does not exist.
- Try --help.
x BUILD FAILED!
edit:
this error just display when desugar_sources: true in fast.xml but when desugar_sources: false there is not errors displayed it is work fine
Your project may have spaces in the directory path. I believe the desugar tool does not accept spaces in the directory path. I will attempt to provide a solution for this issue later.
In the meantime, please move the FAST to a different location where there are no spaces in the path. Then, configure the FAST_HOME variable and the environment path with the new location.
And please, let me know which version of FAST you're using right now?