Android Question B4A 6.80 UNEXPECTED TOP-LEVEL EXCEPTION

Marko Druskovic

Member
Licensed User
Everything work ok in B4A < 6.80


B4A version: 6.80
Parsing code. (0.13s)
Compiling code. (0.18s)
Compiling layouts code. (0.04s)
Organizing libraries. (0.00s)
Generating R file. (0.54s)
Compiling generated Java code. (2.13s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:615)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting
 

Attachments

Marko Druskovic

Member
Licensed User
Thank you Earl for fast answer. I found "okio-1.11.0.jar" and "okio-1.4.0.jar" in main "C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries" folder. In additional libraries folder I don't have these files.

When I try to delete it I get error:

B4A version: 6.80
Parsing code. (0.14s)
Compiling code. (0.23s)
Compiling layouts code. (0.04s)
Organizing libraries. (0.00s)
Generating R file. (0.59s)
Compiling debugger engine code. (1.68s)
Compiling generated Java code. Error
Cannot find: C:\Program Files (x86)\Anywhere Software\Basic4android\libraries\okio-1.11.0.jar
 

Marko Druskovic

Member
Licensed User
I did everything you said and still got this error: o_O
I also try to uninstall B4A and install it again, but with no luck

B4A version: 6.80
Parsing code. (0.14s)
Compiling code. (0.35s)
Compiling layouts code. (0.06s)
Organizing libraries. (0.98s)
Generating R file. (0.55s)
Compiling debugger engine code. (2.26s)
Compiling generated Java code. (2.12s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:615)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting
 

udg

Expert
Licensed User
Hi Erel,

since I originally wrote AppUpdating, what am I expected to do about it to avoid such a problem? Thanks.

udg
 

Erel

Administrator
Staff member
Licensed User
You did everything right.

OkHttp native library was updated in this version (it is a major update). Your library referenced the older native libraries. What I did, is I deleted the references to these libraries from the XML file.

You have two options:
1. Manually delete these two lines from the XML:
B4X:
  <dependsOn>okhttp-2.4.0</dependsOn>
  <dependsOn>okio-1.1.0</dependsOn>
And tell developers to add a reference to OkHttp in the libraries list.
This way it will be supported by all versions.

2. Compile your library with B4A v6.80. The result XML will be compatible with v6.80+ (until OKHttp native libraries are updated again).
 

udg

Expert
Licensed User
Since source code is provided I guess that options 2 will be better for those looking for a ready-made solution, expecially for those that didn't download the lib in the past.
Will update it as soon as BA680 is installed.
Thank you for your explanation.

udg
 

techknight

Well-Known Member
Licensed User
Still awaiting for your AppUpdating fix. I cant upgrade to 6.80 yet as all my apps depend on it, and library editing/compiling is still relatively scary to me at this point.
 

techknight

Well-Known Member
Licensed User
I performed your suggestion erel with the AppUpdating xml, and it now crashes with this:

java.lang.NoSuchMethodError: anywheresoftware.b4a.keywords.Common.ToastMessageShow
at eu.dgconsulting.appupdating.cl_appupdate._jobdone(cl_appupdate.java:469)

I assume I will need to start another thread on that.
 

udg

Expert
Licensed User
Hi @techknight , since I'm in the final stage of a product release I can't install B4A 6.80 yet, but @DonManfred was so kind to compile AppUpdating with it and attach it to post #243 of the lib's thread so you don't have to wait for me.
Btw, you can compile the lib yourself since source is provided in post #1.

udg
 
Top