Android Question com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

Favieri

Member
hi everyone,


I've been researching the solution for this error here on the forum but no solution has been found so far.

This started when I downloaded library printing and used it in my project, like this:

B4X:
Private Sub lbSensorial_Click
    Dim tela As B4XView = svw.Panel
    Dim pdf  As PdfDocument
    Dim retn As Rect
    Private rp As RuntimePermissions
    
    retn.Initialize(0, 0, 400dip, 2400dip)
    
    pdf.Initialize
    pdf.StartPage(595, 842) 'A4 size
    pdf.Canvas.DrawBitmap(tela.Snapshot,Null, retn)
    pdf.FinishPage
    Dim out As OutputStream = File.OpenOutput( rp.GetSafeDirDefaultExternal(""), "1.pdf", False)
    pdf.WriteToStream(out)
    out.Close
    pdf.Close

    
End Sub


When compiling

B4X:
B4A Version: 11.00
Parsing code.    (0.03s)
    Java Version: 8
Building folders structure.    (0.05s)
Compiling code.    (0.02s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.10s)
Linking resources    (0.42s)
Compiling generated Java code.    (0.02s)
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)
2 errors; aborting


I do not know what to do
 

Favieri

Member
after removing the new errors I came back with the initial problem:

B4X:
B4A Versão: 11.00
Analisando o código.    (0.01s)
    Java Versão: 8
Building folders structure.    (0.05s)
Compilando o código    (0.23s)
Compilando código dos layouts.    (0.14s)
Organizando bibliotecas    (0.00s)
    (AndroidX SDK)
Compilando recursos    (0.36s)
Linkando recursos    (1.97s)
Compilando o código Java.    (2.99s)
Convertendo Byte Code - DEX otimizado.    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

1640030366727.png
 
Upvote 0
Top