Android Question Error compiling b4a 10.7 and new billing

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi, Im trying to upgrade my app to the new google billing.
I upgrade b4a to 10.7 from 10.2
intall the new library
Replace the subs for the new subs in the Erel thread
Add the manifest line and when compiling I got this error

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Library dex files are not supported in multi-dex mode
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:371)
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)

I have Multidex=true, if I set it to false I got zillons of errors.
What am I doing wrong?
Thanks

PD using the v3 billing and b4a 10.2 works ok.
 

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Yes, it works.
I just add the library to my app (which uses v3 without problem) and got the error shown in my firt post.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
If I remove the FireBaseAdmov lib and all its code from modules and manifest, it works.
Any idea of how to make Admovs work with billing?
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ive deleted my AndroidSdk folder,
make it again
unzip resources_9_20.zip
unzip commandlinetools-win-6609375_latest.zip
run b4a 10.7
goto tools / sdk and install all recommended
opening my app in b4a I get lib does not exists errors
copy my old additionallibs folder to the new AndroidSdk folder
activate again FireBasemobs lib
compile
error: Artefacto de Maven no encontrado: androidx.work/work-runtime
go to sdk and install it and recompile
error: Artefacto de Maven no encontrado: com.google.android.ump/user-messaging-platform
go to sdk and install it and recompile
error:
Convirtiendo byte code a dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Library dex files are not supported in multi-dex mode
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:371)
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)

Dont know what else to do
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ok, done all again without install all recommended and libraries copied to a sub folder of the sdk folder and same error:
Convirtiendo byte code a dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Library dex files are not supported in multi-dex mode
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:371)
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)
 
Upvote 0

MikeSW17

Active Member
Licensed User
You could just zip up your App and post it here..... but it's far better (for you) to try and strip your app down to a simple/trivial example that demonstrates the issue.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ive tried using FireBaseAdMob2 and same reslut
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Library dex files are not supported in multi-dex mode
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:371)
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)

What does Library dex files are not supported in multi-dex mode means, may be I have a wron lib?
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Also try to set Multidex: false and got this errors

Convirtiendo byte code a dex. Error
trouble writing output: Too many method references to fit in one dex file: 70795; max is 65536.
You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
References by package:
4 android.accessibilityservice
4 android.accounts
71 android.animation
....................................................
 
Upvote 0

tucano2000

Active Member
Licensed User
Longtime User
I have the same problem here in a project after updating B4A to 10.70 and SDK with all the recommended ones.
I have another project with about 30 libraries that I normally compile, but the one that uses more than 50 libraries presents this error:

Convertendo Byte Code - DEX otimizado. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Library dex files are not supported in multi-dex mode
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:371)
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)


Edit:

The project I was compiling started to show or this error when I checked the FirebaseAdmob library:

Convertendo Byte Code - DEX otimizado. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$8.updateIndex(DexMerger.java:565)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:574)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:166)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:336)
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)
 
Last edited:
Upvote 0
Top