Android Question desugar Error parsing command line: While parsing option --input=Merged.jar: Merged.jar is not a val

mshafiee110

Active Member
Licensed User
Longtime User
I,m using this b4j app(B4J-Desugar.zip) to resolve this error:


B4X:
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

but when i using B4J-Desugar this error occurs ...

I'm trying to run this project so that I can desugar around 4 .aar files and i keep getting the following error, I have changed all the necessary paths required for the Desugar_deploy.jar file, the folder where the .aar files are etc. what am i doing wrong?



Walter


B4X:
Error parsing command line: While parsing option --input=Merged.jar: Merged.jar is not a valid path: it does not exist.

I having the same error ...
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
1. Wrong forum i guess. desugar is a b4j app, right?
2. You are not giving enough informations.
the merged.jar must be a path and filename.

B4X:
Sub AppStart (Args() As String)
    Dim date As Long = DateTime.DateParse("12/31/1999")
    Log(date)
    javaExe = File.Combine(GetSystemProperty("java.home", ""), "bin/java")
    File.MakeDir(folder, "temp")
    File.Delete(folder, "Converted.jar")
    temp = File.Combine(folder, "temp") ' The path
    DeleteFolderRecursive(temp)
    ExtractAndMergeClasses
    Desugar
    RemoveClassesFromAARs
    Log("Done!")
End Sub

Sub ExtractAndMergeClasses
    Log("extract")
    For Each f As String In File.ListFiles(folder)
        If f.EndsWith(".aar") Then
            archiver.UnZipFiles(folder, f, folder, Array As String("classes.jar"), "")
            archiver.UnZip(folder, "classes.jar", temp, "")
            File.Delete(folder, "classes.jar")
        End If
    Next
    Log("merge")
    Run(zip, Array("-r", File.Combine(temp, "merged.jar"), ".")) ' combining temp path and filename
End Sub
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
1. Wrong forum i guess. desugar is a b4j app, right?
2. You are not giving enough informations.
the merged.jar must be a path and filename.

B4X:
Sub AppStart (Args() As String)
    Dim date As Long = DateTime.DateParse("12/31/1999")
    Log(date)
    javaExe = File.Combine(GetSystemProperty("java.home", ""), "bin/java")
    File.MakeDir(folder, "temp")
    File.Delete(folder, "Converted.jar")
    temp = File.Combine(folder, "temp") ' The path
    DeleteFolderRecursive(temp)
    ExtractAndMergeClasses
    Desugar
    RemoveClassesFromAARs
    Log("Done!")
End Sub

Sub ExtractAndMergeClasses
    Log("extract")
    For Each f As String In File.ListFiles(folder)
        If f.EndsWith(".aar") Then
            archiver.UnZipFiles(folder, f, folder, Array As String("classes.jar"), "")
            archiver.UnZip(folder, "classes.jar", temp, "")
            File.Delete(folder, "classes.jar")
        End If
    Next
    Log("merge")
    Run(zip, Array("-r", File.Combine(temp, "merged.jar"), ".")) ' combining temp path and filename
End Sub

1.I'm using this to wrapping a android lib ...

2.I tested it ,but it still doesn't work and this error occurs

B4X:
Error parsing command line: While parsing option --input=Merged.jar: Merged.jar is not a valid path: it does not exist.
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
First step is to post the full logs.
this is full logs.
B4X:
946585800000
extract
merge
desugar
Error parsing command line: While parsing option --input=Merged.jar: Merged.jar is not a valid path: it does not exist.
Try --help.
2
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
The code is quite simple. You should debug it and find out where it fails.

What do you see inside the temp folder?
All java classes is extracted in temp folder ...
but merged.jar is not created ...
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
Have you downloaded zip-info and set the path of 'zip' as needed?
Yes ,I does it... can you post your zip.exe file that you used it ...
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
Ooopps I tested it ,but not working....

Plaese send me your zip.exe ,tnx
 
Upvote 0

mshafiee110

Active Member
Licensed User
Longtime User
Oh my God, works fine ...
Thanks a lot ❤
 
Upvote 0
Top