Android Question Compile Times Out

RichardN

Active Member
Licensed User
Longtime User
I am returning to an older project to add some simple functionality upgrades. The project already uses:

AppCompat 3.52
OkHttp 1.2
OkHttpUtils 2.7
Sliding MenuWrapper 1.2
SQL 1.5

This project is NOT complicated or large. It has only a single activity with a simple layout. In both Debug & Release the compile will not complete. I extended the process timeout setting with no success. I increased the MaxRamForDex=2048 but still no joy. Any ideas?

B4A Version: 8.50
Parsing code. (0.06s)
Building folders structure. (0.47s)
Compiling code. (0.08s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (5.46s)
Compiling generated Java code. (13.05s)
Convert byte code - optimized dex. Error
Process timed out.
You can change it under Tools - IDE Options.
 

RichardN

Active Member
Licensed User
Longtime User
I am currently working away from my principle development PC using my laptop with an i3 processor and 4gb of RAM.

I increased the timeout value further to 120 seconds and got a successful compile. However the optimised dexer takes forever but at the point where it switches to the standard dexer it is finished in a flash.

It is possible my laptop performance is below par so I have also taken measures there. It would also be helpful to know what element of the Optimised Dexer is causing it to reduce to a crawl so perhaps it can be avoided?

Is it possible the Standard Dexer can be forced at the outset for troublesome projects?
 
Upvote 0

RichardN

Active Member
Licensed User
Longtime User
Erel.... I think we have just found the next IDE modification for the wishlist!

Also... the inevitable question...

What are the disadvantages of only using the standard dexer?
 
Last edited:
Upvote 0

RichardN

Active Member
Licensed User
Longtime User
Having done some reading in Stackoverflow around the subject it appears the most common reason for the optimised dexer to hang is a class conflict between libraries.

Of course you can fix that by removing an offending class from the library using Winzip or something similar.... but you have to do no small amount of detective work to find the culprit.

B4A is getting quite complicated with many contributors submitting their libraries to the forum. Even with my own libraries it is sometimes difficult to keep track of what you have included within. It would be really nice to have some sort of class conflict warning before it all grinds to a halt.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Having done some reading in Stackoverflow around the subject it appears the most common reason for the optimised dexer to hang is a class conflict between libraries.
The optimized dexer is a unique feature of B4A. You will not find any information about it in Stackoverflow.

B4A is getting quite complicated with many contributors submitting their libraries to the forum. Even with my own libraries it is sometimes difficult to keep track of what you have included within. It would be really nice to have some sort of class conflict warning before it all grinds to a halt.
The timeout is not related to such conflicts.

One or more of the libraries in your project depend on google play services. This is a large SDK and makes compilation slower. On a stronger computer (mainly with more RAM) it will be much faster.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
It is worth disabling the optimized dexer if it tends to fail.
Close the IDE, open the INI folder and look for the UseOptimizedDexer option. Set it to false.
Hi, where is that "INI" folder?
 
Upvote 0

advansis

Active Member
Licensed User
Longtime User
Hi, I had the same problem. Solved changing my antivirus settings: ignore the scanning of the folder (and subfolders) containing your project. Hope it helps
 
Upvote 0
Top