πŸƒβ€β™‚οΈ Fast : An Efficient Way to Build Extensions

Could you please elaborate why it's not going to be ethical?

I've identified the issue. I believe I can provide a fix very soon with a bundled JDK8 compiler.

1 Like


(from https://www.oracle.com/legal/terms/)

I am warning you about this, because I was told the same thing by a power user a few years back (when I released an extension IDE and a bundled copy of Java)

Now tell me, do you have permission to bundle a copy of Java JDK8 with your builder? I don't think you do.

1 Like

Thank you for clarifying that. If I were to just take a single jar file from the bundle, do you think there might be an issue with that?

Which jar file are you talking about?

I'm talking about the rt.jar

However, I would like to use the system javac to avoid any potential issues.

Could you please share your insights on OpenJDK?

I don't know much about OpenJDK.

https://www.baeldung.com/oracle-jdk-vs-openjdk

2 Likes

What is this file? Because Rush probably has it.

:loudspeaker: An update is available, v1.1.6 22.10.24.01.43


  • FAST now relies on the system's Java compiler.
  • The Kotlin compiler has been optimized.
  • A few compilation bugs have been fixed.
  • The Desugar tool is optimized to fully support JDK8 & 11.
  • The D8 tool has been optimized.
  • A few modifications to the logging system.
3 Likes

:loudspeaker: An update is available, v1.1.7 22.10.24.21.55


  • The D8 tool is optimized to make it cross-platform compatible.

Today I've did some experiments with the R8 & ProGuard.

:mag: Experiments results:

:white_check_mark: Winner.
:x: Defeated.


Task Name R8 ProGuard
Version 4.0.63 7.6.0
Faster Compilation :white_check_mark: :x:
Better Optimization :x: :white_check_mark:
Better Shrinking :x: :white_check_mark:
Better Obfuscation :white_check_mark: :x:
Easy Configuration :x: :white_check_mark:
Desugaring Features :x: :x:
Enum Obfuscation :x: :white_check_mark:
HelperClassesObfuscation :x: :white_check_mark:
GenerateUnreadableCode :white_check_mark: :x:
Reduce 421KB to 250KB 185KB

Do you think that I should add the R8 tool instead of the ProGuard or as an optional tool?

2 Likes

You might have a way to choose an option between both, this will make Fast more fast :sweat_smile:

2 Likes

If these are the results then I don't think r8 is necessary since proguard works well. After reading this article I thought the r8 was better:

What does it mean?

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.

2 Likes

You can also use Blaze IDE

:loudspeaker: An update is available, v1.1.8 24.10.24.20.40


  • Added R8 tool as an optional optimizer. Use -s to run R8. (Experimental)
  • Changed proguard-rules.pro to be compatible with R8.
  • Simplified proguard-rules.pro.
  • A few minor bugs have been fixed.
3 Likes

What do these warnings mean during compilation and can I get rid of them?

warning: unknown enum constant AnnotationRetention.BINARY
  reason: class file for kotlin.annotation.AnnotationRetention not found
warning: unknown enum constant AnnotationTarget.FUNCTION
  reason: class file for kotlin.annotation.AnnotationTarget not found
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.VALUE_PARAMETER
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.LOCAL_VARIABLE
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationTarget.FILE
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.VALUE_PARAMETER
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.LOCAL_VARIABLE
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationTarget.FILE
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.CLASS
warning: unknown enum constant AnnotationTarget.PROPERTY
warning: unknown enum constant AnnotationTarget.LOCAL_VARIABLE
warning: unknown enum constant AnnotationTarget.VALUE_PARAMETER
warning: unknown enum constant AnnotationTarget.CONSTRUCTOR
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.FILE
warning: unknown enum constant AnnotationTarget.TYPEALIAS
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.VALUE_PARAMETER
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.LOCAL_VARIABLE
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.VALUE_PARAMETER
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.LOCAL_VARIABLE
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationTarget.CLASS
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.CONSTRUCTOR
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.FILE
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationTarget.CLASS
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationTarget.CONSTRUCTOR
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.FILE
warning: unknown enum constant AnnotationTarget.FIELD
warning: unknown enum constant AnnotationTarget.FUNCTION
warning: unknown enum constant AnnotationTarget.PROPERTY_GETTER
warning: unknown enum constant AnnotationTarget.PROPERTY_SETTER
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationRetention.BINARY
warning: unknown enum constant AnnotationTarget.ANNOTATION_CLASS
warning: unknown enum constant AnnotationRetention.BINARY

I tried R8, but I don't know if it works:

  • fast build : extension is 11MB
  • fast build -o : extension is 14MB
  • fast build -s : extension is 11MB
  • fast build -r : extension is 4MB

I don't know how optimization works, but it probably works the other way around. Do I need a different rules file to use r8?

Ok I see there are new properties in fast.xml. By the way, why properties in xml file if we use flags -s, -r?

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.

1 Like

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)

In the latest version proguard reported a missing class that the previous version did not report.

Could you elaborate more, please?

1 Like