Android Question [SOLVED] com.android.dx.cf.code.SimException

josejad

Expert
Licensed User
Longtime User
Hi all:

I have a small app to open the garage door.
It's made with B4XPages and it was working.
Now I want to make some changes, and I get the error you can see in the logs.

B4X:
B4A Versión: 10.70
Parseando código.    (0.33s)
    Java Versión: 8
Building folders structure.    (0.17s)
Compilando código.    (0.70s)
Compilado códigos de diseños.    (0.01s)
Organizando librerías.    (0.00s)
    (AndroidX SDK)
Compilando los recursos    (0.24s)
Enlazando los recursos    (0.98s)
Compilando el código del motor de depuración.    (0.04s)
Compilando el código Java generado.    (0.08s)
Convirtiendo byte code a dex optimizado.    Error
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
    at com.android.dx.command.dexer.Main.runDx(Main.java:293)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
    ... 4 more

I've searched the forum and I've seen it's related with "desugar" some libraries.
I think all the libraries I have in my project are "standard" libraries, except maybe jMQTT

I've tried to "desugar" it adapting the command in this thread, but I don't know how to adapt the "gson-2.3.1.jar" part.

B4X:
"c:\java\jdk1.8.0_291\bin\java" -jar Desugar_deploy.jar --bootclasspath_entry="C:\android\platforms\android-30\android.jar" --input="c:\JJ\jMQTT.jar --output=jMQTT.jar --bootclasspath_entry="C:\Users\H\Documents\AdditionalLibs\B4A\gson-2.3.1.jar"

1622468603679.png


Thanks.
 

josejad

Expert
Licensed User
Longtime User
Trying more things, I get the same error with the [B4X] [B4XPages] Firebase Push Example


Tested with OpenJDK 11 + OpenJFX 11 and Oracle JDK 8
 
Last edited:
Upvote 0

JohnC

Expert
Licensed User
Longtime User
What changed from the time "it was working" to when you started to get the errors?
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hi John:

In fact, nothing, I was re-compiling before start to change nothing.

As I said in the second post, same error with the Push example, and the only libraries it has are FirebaseAnalytics and FirebaseNotifications.

So probably some kind of error with my configuration and these libraries:

1622473850381.png
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
If nothing changed, then I would try just rebooting your PC.

I've wasted hours, more then once, on a problem that just a reboot fixed.

Also, how much time pasted from the last time it was working until today? (when was the last time it was working?)
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Thanks again, the PC have been rebooted (that’s always the first step)

It was working four months ago I think.

Later I will try to compile in my home laptop
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
It works in my home laptop, so it's something with my config.

Both computers are the same config. I will try to download the SDK again.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Yeah, whenever I see people post "it was working, but now I'm getting errors", it is usually after they upgraded B4A.

And the usual fix is to reinstall the SDK.

But you said you didn't change anything, so I wonder how the SDK got messed up.
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
It works in my home laptop, so it's something with my config.

Both computers are the same config. I will try to download the SDK again.
Two identical desktops were purchased in the same store all together. Ran the same web site in the same browser (IE 10 at that time). One is Ok, second - stupid JS error.
Installed FF on both computers. The same story:)
So, you got the point:)
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
JordiCP has just pointed me, just over my post is probably the solution. Tomorrow I will check (I didn't see that result when I searched the forum... ?)

1622490564714.png
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Solved. The solution in this thread


was not valid for me, because I had the firebase-datatransport version 17.0.8, but it has been solved downloading the:
- Android SDK Command line tools
- required resources
as indicated in https://www.b4x.com/b4a.html, and everything have worked again.

Thanks you all, specially @JohnC, justly deserving the great support award

1622529916718.png
 
Upvote 0
Top