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

I'm not familiar with R8. I've to learn it first. However, I was getting the same issue that you're getting now. Then I've enabled the desuagr_dex and the issue is gone. (Tried with ProGuard and also without ProGuard)

I've compiled the code that you provided earlier using JDK11. And everything goes fine, also on Kodular, too.

I am currently using the d8 version 4.0.63.

I've also tried with JDK17.

pl.patryk_f.testlambda.aix (3.8 KB)

1 Like

Yes, it's a simple extension without additional libraries, as I mentioned it packs all androidx libraries and more into the extension. My extension without proguard is about 12MB.
Using rush with the same code and libraries I don't have to desugate dex and the extension builds without a problem.

1 Like

I think I figured out what the problem was. It was because of the version of d8 I was using. I switched to an older version and now it's working fine. You might want to do the same. Thanks again for all your help and addressing issues.

1 Like

I tried using the D8 files in Fast that I use in Rush and it didn't improve the compilation.

Maybe you have an extension in your resources for which you had to pack androidx libraries because the ones from appinventor were too old. Try Fast on that extension.

2 Likes

:loudspeaker: An update is pushed, v1.1.5 19.10.2024.23.55


  • Fixed DEX bytecode generating stuck issue.
  • More debug information will be written to logs.txt
3 Likes

Now my extension compiles but only with dex desugaring. It's possible that Rush has it permanently by default.

2 Likes

Please let me know that what happens when you disabled the desuagr_dex?

To read a few additional debug info on the terminal, pass -d with the build command.
Example:

fast build -d
2 Likes

The problem seems to be the version of Java we are compiling in. If we compile in Java8, the compilation requires minSDK set to 24 in Fast.xml, and if in Java11, then minSDK - 26. Then the compilation is successful.

Error: Invoke-customs are only supported starting with Android O (--min-api 26)

Which is weird because the libraries I'm using have minSdk 21. So I think it's about the java version.

Is it possible that java11 is supported from sdk26? I have to test it on an emulator.

A similar error is described here:

This means that java8 functions may not be supported before api26.

I also read somewhere that java11 functions are fully supported from api33 onwards.

The most important thing is that the compilation ends successfully. I still need to test all the extension functions, whether all the classes will be available.

2 Likes

This is the reason why the desugar tool was created. It ensures that the code and libraries are compatible with older devices.

When you write code using Java 8 features

desugar_sources: true

When any of your dependencies use Java 8 features.

desugar_deps: true
1 Like

I got below error, how to fix it?
image

Fast version 1.1.5 19.10.2024.23.55
Windows 7.

2 Likes

Could you please send me the logs.txt?

1 Like

logs.txt (1.4 KB)

2 Likes

Is the older version of FAST was able to compile successfully?

1 Like

that's on another computer (Win10 at home), it's working. now this error is on Win7 at my office.

2 Likes

Ok, I've got the issue. The Windows 7 is pointed to JRE instead of JDK. Could you please confirm me that is the javac command working on your Windows 7?

1 Like

like this?

image

2 Likes

Check your environment variables in your system settings. JAVA_HOME is probably set to jre and not jdk.

JAVA_HOME: C:\ProgramFiles\Java\jre-1.8

1 Like

I'm trying to implement a bundled Java compiler, so the FAST won't rely on the system's javac.

1 Like

Are you sure it's going to be ethical to do so?

Win7 Pro, 64-Bit:

grafik

1 Like