Android Question JdbcSQL only working with earlier MariaDB Connector/J

Peter Simpson

Expert
Licensed User
Longtime User
Just a quick one.
I noticed when updating a clients B4A application that only the #AdditionalJar: mariadb-java-client-1.1.8.jar that the app was originally created with works in B4A, #AdditionalJar: mariadb-java-client-2.4.2.jar or #AdditionalJar: mariadb-java-client-2.5.4.jar causes the following compilation error.

It does not bother me at all as I will just keep using #AdditionalJar: mariadb-java-client-1.1.8.jar as it works perfect and always has done. I just fancied updating the Connector/J to the newest version as I use the newest version in the same clients B4J desktop application. By the way all the aforementioned mariadb-java-client files work in B4J, but only the earlier files works in B4A.

B4A Version: 9.80
Java Version: 11
Parsing code. (0.00s)
Building folders structure. (0.03s)
Compiling code. (0.04s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (0.00s)
Compiling generated Java code. (0.00s)
Convert byte code - optimized dex. Error
Picked up _JAVA_OPTIONS: -Xmx1024m -Xms1024m -XX:-UseGCOverheadLimit
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

There's absolutely no need for my client to use jRDC2, so don't mention it.

Cheers...
 

Peter Simpson

Expert
Licensed User
Longtime User
I had already seen that but post but I wasn't quite sure what on earth to do with it or even how to use it and how to link it to the .jar files named above. I think that my problem was that as the first library I have already works, I wasn't that bothered about the rest not working, so I just skimmed the link and didn't take it in.

As you've taken the time to reply, I'll look at the link in more details later when I come back from my meeting.

Cheers @OliverA...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The solution is to "desugar" the jar
In this case it will not help i guess. I tried to use the b4j desugar project.

This was the output
extract
merge
zip error: Nothing to do! (try: zip -r E:\Desugar\temp\merged.jar . -i .)
12

The jar internally depends on a lot of imports like this one
B4X:
import com.sun.jna.*;
import com.sun.jna.platform.win32.*;

I found out by downloading the sources of this jar here
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
In this case it will not help i guess.

The jar internally depends on a lot of imports like this one
Looking at the old 1.1.8 source, it has them too. Looks like on Windows platform, it will use the JNA related "stuff", on other platforms the standard Java "stuff". In 1.1.8 it seems to be just for Socket handling, in 2.5.4 also to PID and Authentication handling.
 
Upvote 0

OliverA

Expert
Licensed User
I'm just wondering if you need to include them at all on the Android platform, since those classes that do depend on the JNA stuff will never be created under Android.
 
Upvote 0
Top