Android Question Slow Compiling and Convert Dex

Chianca

Member
Licensed User
Longtime User
Hello, I'm having some problems when trying to deploy or debug my App. It has some libs and files, but it's taking a long time compiling and converting DEX, as you can see in the image below.

b4a-compile.png


I have Increased MaxRamForDex for 3000, but not positive effect.
MaxRamForDex=3000

Computer: Intel Core i7, 8GB Ram, SSD

How can I improve the time of converting byte code - dex?
 

Attachments

  • b4a-compile.png
    b4a-compile.png
    11.6 KB · Views: 159
Last edited:

Scantech

Well-Known Member
Licensed User
Longtime User
First Run
B4A Version: 10.2
Java Version: 8
Parsing code. (3.02s)
Building folders structure. (0.18s)
Compiling code. (9.13s)
Compiling layouts code. (0.11s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (14.34s)
Compiling generated Java code. (14.78s)
Convert byte code - optimized dex. (57.61s)
Optimized dexer failed. Switching to Standard dexer.
Packaging files. (5.16s)
Copying libraries resources (0.34s)
Found 49 resource files.
Signing package file (private key). (2.76s)
ZipAlign file. (0.13s)
Installing file to device. Error
No device found.

Second Run
B4A Version: 10.2
Java Version: 8
Parsing code. (1.35s)
Building folders structure. (0.12s)
Compiling code. (4.17s)
Compiling layouts code. (0.08s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (0.09s)
Compiling generated Java code. (0.37s)
Convert byte code - optimized dex. (50.82s)
Packaging files. (5.08s)
Copying libraries resources (0.11s)
Found 49 resource files.
Signing package file (private key). (2.80s)
ZipAlign file. (0.12s)
Installing file to device. Error
No device found.

This is a very very very huge project.

Just wanted to share and compare it with you. Your Debugger engine code and java should decrease after 1st attempt in compilation. The top 2 quote is in debug mode. My release mode can take anywhere from 120 to 200 seconds with covert byte code.

I have Samsung Notebook 7 from 2016 with 12GB memory and iCore 7.
 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
I don't know if it will do anything but you are using old java 8 version. Maybe try to go to 11. Your computer has good parameters but what is its state, you should know best.

P.S.
Also, try to clean the project from time to time (ctrl + p).
 
Last edited:
Upvote 0

Chianca

Member
Licensed User
Longtime User
First step is to upgrade to B4A v10.2.

I have upgraded to B4X v10.2. Here are the new compile time.

1601488712261.png


That's all next 140 seconds. This is normal for medium to huge project?
There is more things to check to improve speed?


Thank You!
 
Upvote 0

fatman

Active Member
Licensed User
Longtime User
Check if antivirus increases compilation time.
Microsoft Defender slowed down B4A on my computer significantly.
 
Upvote 0
Top