Other B4A v11.5 BETA is available for download

Status
Not open for further replies.

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm happy to release v11.50 BETA #1. This is an important update.
One of the major steps during compilation is the conversion of the Java bytecode into Android (Dalvik) runtime bytecode. It is called "dexing". This was done by the optimized dexer which was implemented before B4A v1.00 was released. The main problem with the previous tool was the lack of support for Java 8 features, which are now used by many newer SDKs.
The workarounds didn't always work.

Starting from v11.50 the optimized dexer was removed and B4A uses Google's D8 tool during compilation. It is more powerful and it is also faster, especially with larger projects, as it allows implementing incremental compilation. Libraries are dexed once when needed. The code is also dexed incrementally.

Other than that this version also adds support for targetSdkVersion = 31. I still recommend setting it to 30 for now.

  • Optimized dexer replaced with D8 tool.
  • Support for targetSdkVersion=31.
  • New #ExcludedLib attribute that is required in some cases when multiple native libraries with different versions are referenced.
  • Updated internal libraries: OkHttp v1.50, OkHttpUtils2 v3.00, PreoptimizedCLV v1.21, Network v1.53, B4XTable v1.22, KeyValueStore v2.31, SMM v1.12, NB6 v1.02, FirebaseNotifications v2.01, B4XCollections v1.13
  • #ExcludedClasses attribute removed.
  • Bug fixes and other minor improvements.
Note that the code signing certificate was replaced. This can lead to false malware detections.

Download link: https://www.b4x.com/android/files/beta.exe
Please start a new thread if/when you encounter any problem with the beta.

If you want to set targetSdKVersion to 31 then the main changes are:
- When requesting the fine location permission the user can choose to limit your app to coarse location. The code to handle it is:
B4X:
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result Or rp.Check(rp.PERMISSION_ACCESS_COARSE_LOCATION) Then
 'we have location permission
End If
- With a few exceptions it is no longer possible to start services in the background. One of the consequences of this restriction is that push notification messages should be sent as high priority messages. You need to set it in the B4J sending code:
B4X:
m.Put("priority", 10)
- StartServiceAt / StartServiceAtExact: https://www.b4x.com/android/forum/t...-is-available-for-download.139120/post-880849
 
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
It is working with my latest project:
B4A V11.5 Beta:
B4A Version: 11.50 BETA #1
Parsing code.    (0.01s)
    Java Version: 11
Building folders structure.    (0.03s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.11s)
Linking resources    (0.46s)
Compiling generated Java code.    (0.00s)
Finding libraries that need to be dexed.    (0.00s)
Dex code    (0.77s)
Dex merge    (2.61s)
Copying libraries resources    (0.47s)
ZipAlign file.    (0.04s)
Signing package file (debug key).    (1.24s)
Installing file to device.    (5.74s)
    Device serial: RF8M70NF4RL
Completed successfully.
 

73Challenger

Member
Licensed User
Ya know...I've written a good sized project in B4X (25k lines+)....I read @Erel s post and don't understand any of it LOL! A heartfelt thank you @Erel for this amazing tool and doing the "dirty work" that enables us to concentrate on app development instead of the low level technical. Amazing!
 

Spavlyuk

Active Member
Licensed User
After manually updating to android-31 jar I am getting getting the following error.
The compilation seems to be working with Java 11. Will Java 8 be unsupported in the future?

B4X:
B4A Version: 11.50 BETA #1
Parsing code.    (0.24s)
    Java Version: 8
Building folders structure.    (0.07s)
Compiling code.    (0.47s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (1.71s)
Linking resources    (1.25s)
Compiling debugger engine code.    (2.90s)
Compiling generated Java code.    Error
javac 1.8.0_271
An exception has occurred in the compiler (1.8.0_271). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)
    at com.sun.tools.javac.util.Assert.error(Assert.java:133)
    at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231)
    at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294)
    at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitVarDef(TypeAnnotations.java:1164)
    at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852)
    at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
    at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
    at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
    at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042)
    at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)
    at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
    at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275)
    at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127)
    at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152)
    at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129)
    at com.sun.tools.javac.comp.Enter.complete(Enter.java:512)
    at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
    at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
    at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
    at com.sun.tools.javac.main.Main.compile(Main.java:523)
    at com.sun.tools.javac.main.Main.compile(Main.java:381)
    at com.sun.tools.javac.main.Main.compile(Main.java:370)
    at com.sun.tools.javac.main.Main.compile(Main.java:361)
    at com.sun.tools.javac.Main.compile(Main.java:56)
    at com.sun.tools.javac.Main.main(Main.java:42)
 
Status
Not open for further replies.
Top