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)
 

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Got it downloaded and installed, and I must say the same re-compiled apps on the same device are noticeably faster. Everything from screen display to general operation. Well done, @Erel!
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
He did it. Yes, he did it. You can highlight more than one line in the IDE, right click , select 'Duplicate Line'. It will duplicate more than one line. It duplicates all the highlighted lines.
I see this in version 11.20 too :)
 
Last edited:
Upvote 0

Star-Dust

Expert
Licensed User
Note that the code signing certificate was replaced.
What exactly is meant? we talk about the signing of the APKs or the signing of the AABs
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
What exactly is meant? we talk about the signing of the APKs or the signing of the AABs
It's to do with making installation easier for software vendors to install their software onto Windows OS. That red/orange warning that you might see during or after downloading/installing software from the net when. It's a pain in the butt if you ask me, but I too have paid for a code signing certificate for my business (mine is Comodo).

@Erel I'm still having the same problem as reported previously by myself, but I do have a way to install it without issues. Believe it or not I have to use Internet Explorer and not any other browser. No it's not to do with downloading, but it's to do with execution even though everything is turned off. If you require a video, please reply to my previous correspondence to you.

Anyway thank you for the updated software and the support, it's absolutely brilliant as usual 👍👍👍
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
No. It is not in version 11.20, unless there was an update to 11.20 that I was not aware of. . You better edit your post if we find out it was not in 11.20
You are right. The Duplicate Line in version 11.20 only Duplicate a Line, not multiline.
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
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.
Excellent improvement decision, THANKS
 
Upvote 0

eelias

Active Member
Licensed User
Longtime User
I just installed and compiled my biggest project

B4X:
B4A Version: 11.50
Parsing code.    (1.14s)
    Java Version: 8
Building folders structure.    (0.07s)
Compiling code.    (0.68s)
Compiling layouts code.    (0.08s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.42s)
Linking resources    (0.87s)
Compiling generated Java code.    (0.09s)
Finding libraries that need to be dexed.    (0.03s)
Dex code    (1.28s)
Dex merge    Error
Error in C:\Android\tools\..\extras\b4a_local\unpacked-okhttp-3.12.12-63775096572000\dex_v1\okhttp-3.12.12.zip:classes.dex:
Type okhttp3.Address is defined multiple times: C:\Android\tools\..\extras\b4a_local\unpacked-okhttp-3.12.12-63775096572000\dex_v1\okhttp-3.12.12.zip:classes.dex, C:\Android\tools\..\extras\b4a_local\unpacked-okhttp-4.9.0-63783472550000\dex_v1\okhttp-4.9.0.zip:classes.dex
Compilation failed

What should i do?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
What should i do?
Delete your SDK and B4A and Install it new.

okhttp-4.9.0 is part of the B4A 11.5 installation. 3.12. seems to be an old version
 
Upvote 0

eelias

Active Member
Licensed User
Longtime User
Delete your SDK and B4A and Install it new.

okhttp-4.9.0 is part of the B4A 11.5 installation. 3.12. seems to be an old version
B4X:
B4A Version: 11.50
Parsing code.    (1.26s)
    Java Version: 8
Building folders structure.    (0.07s)
Compiling code.    (0.70s)
Compiling layouts code.    (0.08s)
Organizing libraries.    (0.03s)
    (AndroidX SDK)
Compiling resources    (1.35s)
Linking resources    (0.84s)
Compiling generated Java code.    Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\okhttp-3.12.12.jar

I am still get this, and dont find who is using it, is there a way to find out, I have many libraries
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
the other startservice methodt required: StartServiceAtExact, add permision , and priority..

a) ONLY are neccesary for target 31?
b) Previous proyect, only are affected by thenique for compile, but is not neccesary check or change code?
c) when you say more fast, this is about compile or final app running (somebody say more fast app!!!! this is no correct.. no?

(new Donate go... thanks Erel. )
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
omebody say more fast app
The D8-Tool Erel mentioned is faster than the old dexer.

I don´t think that the app will run faster. It is still a java app. It was already fast in the past!

The compiling-part IS definetively MUCH faster. The first one not but after the first one it will be much faster as it allows implementing incremental compilation. Libraries are dexed once when needed. The code is also dexed incrementally. This results in faster compilationtimes.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
I don´t think that the app will run faster. It is still a java app. It was already fast in the past!
You are correct, and I didn't run a benchmark test on old vs. new. Subjectively, to me, once I installed the new compilation on the cheap tablet that I am testing with, it seemed to be faster to me (faster screen transitions, snappier responses to clicks, etc.). I did increase the target SDK on the app as it suggested, other than that I made no changes to the app before recompiling.

I don't think changing the target SDK would produce that, and I won't rule out confirmation bias either ;)
 
Upvote 0
Status
Not open for further replies.
Top