Android Question Ho to bypass this error: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

abilio486software

Active Member
Licensed User
Hello,

Thanks to your contribute, I extract the res folder and rectify the missing resources, but now I have this error when compiling the attached project with this library

I also include the "res_aditional" file to be extracted to the project folder.

What can be done to use this .aar with B4A?

Many thanks šŸ™

Error when compiling:
B4A Version: 10.60
Parsing code.    (0.00s)
    Java Version: 8
Building folders structure.    (0.01s)
Compiling code.    (0.04s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (1.51s)
Compiling debugger engine code.    (0.88s)
Compiling generated Java code.    (3.23s)
Convert byte code - optimized dex.    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.runMultiDex(Main.java:366)
    at com.android.dx.command.dexer.Main.runDx(Main.java:291)
    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
 

Attachments

  • verifone_project.zip
    10.2 KB · Views: 184
  • res_aditional.zip
    267.1 KB · Views: 196

sadeq.hitex

Member
Licensed User
Some of the new Android libraries use Java 8 features. Android doesn't natively support those features so they must be removed (desugared) at some point.

When you wrap a library that includes such features you need to desugar the wrapped library. This is done with an Android tool named desugar.

So you have to use desugar tool to fix this problem

 
Upvote 0

abilio486software

Active Member
Licensed User
So you have to use desugar tool to fix this problem


Thanks to Erel contribute (with a specific desguared command to my case) I already desguared the aar classes.jar, to a new and usable .jar, but the .jar needs ".so jni library files" not included in the .jar, because they are in the .aar

Because of that, Ithink I need to use the .aar
 
Upvote 0

abilio486software

Active Member
Licensed User
You can change your 'JNI FOLDER' to 'lib' and zip it , then rename it to yourJni.jar
and use #AdditionalJar
or put it into your aar file.

Now I have the Erel's desguared jar working with your suggestion, an aditional jar only with the needed binary .so libraryes. amaizing!

Once again thanks and I'm sure your recomendation will very important for other developers with same issues.
 
Upvote 0
Top