Android Question B4A V10.0 BETA #1 - Always -> Optimized dexer failed. Switching to Standard dexer.

scsjc

Well-Known Member
Licensed User
Longtime User
I just installed the new version, and I have tried several times but it always compiles me with: Optimized dexer failed. Switching to Standard dexer.

1594222703865.png


I don't know if it has something to do, but I had to install it from sdkmanager:

firebase-installations
firebase-installations-interop

and perhaps for this reason it takes longer?
 

scsjc

Well-Known Member
Licensed User
Longtime User
Does it still always fail? Does it happen with a specific project or all your projects?

It only happens to me in a project

Yesterday I was doing tests and delete line : #AdditionalJar: com.google.firebase: firebase-core (used for Crashlytics) and compile ok
Crashlytics work fine without this line, confirmed :)


I don't know why I put it in at a certain time, but I have removed it and compiles it every time well
 
Last edited:
Upvote 0

asales

Expert
Licensed User
Longtime User
Same here, in all my projects.
I use the crashlytics too.
But it only happens in the first compilation. When I compile again, I don't see this message "dexter failed".
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Note that it always compiles ok, even if the optimized dexer fails. It just means that compilation will be a bit slower.

If you are able to reproduce it with a not too large project then please upload it or send it to me.


my project is big and maybe that's what makes that error jump.

I have solved it by removing: #AdditionalJar: com.google.firebase: firebase-core and it works almost 90% of the time without error in dexter

I see that the chrashlytics continues to work without this line ... or so I think :)
 
Upvote 0

asales

Expert
Licensed User
Longtime User
I have solved it by removing: #AdditionalJar: com.google.firebase: firebase-core and it works almost 90% of the time without error in dexter

I see that the chrashlytics continues to work without this line ... or so I think :)
I have this line too - in all my projects - and, like I said, the dexter don't failed in the second compilation (even with this line).
I'll test if I removing this line, I don't have problems with the crashlitycs.
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
All My apps have this line, and that error does not happen to me.
It only happens in a large project, I think it must be because of the size of the project.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I have this a lot with pre 10.0 versions aswell.

It sometimes seems that the dexer gets stuck and only eats a lot of memory.
if it completed with the other dexer and you compile again it's suddenly fast again.

indeed especially noticable when using firebase. all the projects without firebase compile a lot faster (less file collecting to do)

what improved things a lot is putting an exclusion on c:\Android and *\objects in my anti-virus (avast) and it's less stuck than before too.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Even I disable this line before compilation:
B4X:
#AdditionalJar: com.google.firebase:firebase-core
I get the message "dexter fail" in the first compilation.
If I compile again, I don't see the message.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Same project, compiled with B4A 9.90 and B4A 10.0 beta:

B4X:
B4A Version: 9.90
Java Version: 8
Parsing code.    (0.88s)
Building folders structure.    (2.03s)
Compiling code.    (1.16s)
Compiling layouts code.    (3.68s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (4.28s)
Compiling generated Java code.    (14.62s)
Convert byte code - optimized dex.    (43.21s)
Packaging files.    (5.99s)
Copying libraries resources    (0.30s)
    Found 62 resource files.
Signing package file (private key).    (4.44s)
ZipAlign file.    (0.27s)
Installing file to device.    (15.21s)
    Device serial: 0023619015
Completed successfully.

B4X:
B4A Version: 10.0 BETA #1
Java Version: 8
Parsing code.    (1.00s)
Building folders structure.    (0.14s)
Compiling code.    (1.11s)
Compiling layouts code.    (0.31s)
Organizing libraries.    (0.09s)
    (AndroidX SDK)
Generating R file.    (5.20s)
Compiling generated Java code.    (20.96s)
Convert byte code - optimized dex.    (42.15s)
    Optimized dexer failed. Switching to Standard dexer.
Packaging files.    (5.95s)
Copying libraries resources    (0.30s)
    Found 62 resource files.
Signing package file (private key).    (4.35s)
ZipAlign file.    (0.25s)
Installing file to device.    (12.92s)
    Device serial: 0023619015
Completed successfully.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
what improved things a lot is putting an exclusion on c:\Android and *\objects in my anti-virus (avast) and it's less stuck than before too.
I use Kaspersky and even I disable the antivirus, I don't have any improve in the compilation process.
 
Upvote 0

davemorris

Active Member
Licensed User
Longtime User
Hi Guys
I have been working on a project, and as long as I can remember I got the message with B4A versions up to and including v9.9.

B4X:
Optimized dexer failed. Switching to Standard dexer.
However, whilst working on a problem relating to permissions (and check if it still occurred in v10 beta)
https://www.b4x.com/android/forum/t...ons-fusedlocationprovider.119746/#post-750935
I found with v10 Beta the error report about "the dexer failed" had simply gone.

Regards
Dave
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
I have this a lot with pre 10.0 versions aswell.

It sometimes seems that the dexer gets stuck and only eats a lot of memory.
if it completed with the other dexer and you compile again it's suddenly fast again.

indeed especially noticable when using firebase. all the projects without firebase compile a lot faster (less file collecting to do)

what improved things a lot is putting an exclusion on c:\Android and *\objects in my anti-virus (avast) and it's less stuck than before too.


It is a good solution, I have the ESET antivirus and I have disabled the folders:

C: \ Android \
C: \ Program Files (x86) \ Anywhere Software \
\ ProjectFolder \

this makes compilation faster, and avoids "Optimized dexer failed. Switching to Standard dexer"
 
Upvote 0
Top