Other B4A v11.50 has been released!

Status
Not open for further replies.

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm happy to release v11.50. This is an important update.
Download link: 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.

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: You need to use StartServiceAtExact and add this "non-dangerous" permission:
B4X:
AddPermission(android.permission.SCHEDULE_EXACT_ALARM)
 

DonManfred

Expert
Licensed User
Longtime User
seemed to be faster to me (faster screen transitions, snappier responses to clicks, etc.)
i may be wrong too. I didn´t care about performance as i never had any performanceproblems in the past.

Compilationtimes i always have and i am happy about the new D8 dexer. Especially on bigger projects.
 
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi Guy

In the post Erel refers to
m.Put("priority", 10)
Looking at the B4J send tool it appears that this is only used for messages starting with "ios_" (which is believe is for IOS devices), could someone elaborate on the implications regarding Andriod devices.

Thanks for the help.
Dave Morris
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Just info in case it is helpful.
Had a little scare. Was necessary to clean, recompile three times before the debugger would connect to my cold-booted Pixel AVD. Was just about to try a real device and then it worked. Emulator said "Waiting for Debugger to Connect".
 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
Just one clarification about background services: is the new background services behavior ONLY for sdk target > 30? To me this seems a big change..would it be possible to make a dedicated post explaining maybe with a sample app how to deal with background services with sdk>30? Thanks
 
Upvote 0

Jeanc161

Member
Licensed User
Longtime User
Does that mean that service Starter is not started automatically when starting the app or do we have to make a call to start the service with the app.
That part i don't understand the repercussions on the Starter service of the app when started, can you explain a little bit more before i switch to that new version, i'm am still on version 11 of B4A and i did not download the other new versions I use the SDK 30 on my app.

Thanks
 
Upvote 0

Jim McDougal

Member
Licensed User
Just installed B4A 11.5 upgrading from 10.2. Got the following compile errors:

B4A Version: 11.50
Parsing code. (0.43s)
Java Version: 11
Building folders structure. (0.07s)
Compiling code. (0.35s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.10s)
Linking resources (0.74s)
Compiling generated Java code. (0.04s)
Finding libraries that need to be dexed. Error
d8.jar missing

My configure paths currently point to:

C:\Program Files\Java\jdk-11.0.1\bin\javac.exe
C:\Android\platforms\android-28\android.jar

which worked fine with the old version. Any suggestions?

Thanks!
 
Upvote 0

NGUYEN TUAN ANH

Active Member
Licensed User
Dear All,
Could you please help me
i upgrated from 11.20 to 11.50
Compile Error
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.09s)
Linking resources (3.60s)
Compiling generated Java code. (2.30s)
Finding libraries that need to be dexed. (0.01s)
Dex code (2.06s)
Dex merge Error
Error in D:\Android\tools\..\extras\b4a_local\unpacked-kotlin-stdlib-1.3.71-63720573988000\dex_v1\kotlin-stdlib-1.3.71.zip:classes.dex:
Type kotlin.ArrayIntrinsicsKt is defined multiple times: D:\Android\tools\..\extras\b4a_local\unpacked-kotlin-stdlib-1.3.71-63720573988000\dex_v1\kotlin-stdlib-1.3.71.zip:classes.dex, D:\Android\tools\..\extras\b4a_local\unpacked-kotlin-stdlib-1.6.10-63783436550000\dex_v1\kotlin-stdlib-1.6.10.zip:classes.dex
Compilation failed
 
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…