Android Question Lottie & HMS (Huawei)

fbritop

Active Member
Licensed User
Longtime User
I´ve scratch down the folowing logs

B4X:
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/package-info;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$Watchdog;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Base64;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$2;
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

After adding and removing libraries, I could escape the problem to the new HMS library. Not sure where the problem is, as I cannot check inside the HMS library. Has someone got into this?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This error means that a library jar mistakenly embeds the classes of a dependent library, instead of referencing them. Open lottie jar or aar and delete those classes.

Another option is that there are references to two different versions of okio library. This should be easily fixed by editing the library XML file.

as I cannot check inside the HMS library
Sure you can. It is a b4xlib library.
 
Upvote 0

fbritop

Active Member
Licensed User
Longtime User
Well yes it can be modified. The thing is once you modified and time passes, you forget what you did and then it leads to a new error/bug in our code.


Better to comment okio from the additional I think

B4X:
#AdditionalJar:androidx.core:core
#AdditionalJar:androidx.appcompat:appcompat
#AdditionalJar:Lottie.aar
#AdditionalJar:kotlin-stdlib-1.3.21
#AdditionalJar:kotlin-stdlib-jdk7-1.3.21
#AdditionalJar:Lottie-assets.aar
'#AdditionalJar:okio-1.17.4.jar
 
Upvote 0
Top