Android Question Problem after updating to Mobile ads v20

Status
Not open for further replies.

tufanv

Expert
Licensed User
Longtime User
Hello,

To use firebaseadmob 2 I updated the googlemobileads sdk to 20. After that I got some error messages regarding firebase encoders, androidwork etc. I updated them all with sdk manager but I started to get:

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

after some research on the forum I added:

#MultiDex: True

and now I am getting:

B4X:
B4A Version: 10.70
Parsing code.    (0.12s)
    Java Version: 11
Building folders structure.    (0.02s)
Compiling code.    (0.13s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.04s)
    (AndroidX SDK)
Compiling resources    (0.19s)
Linking resources    (0.72s)
Compiling generated Java code.    (2.76s)
Convert byte code - optimized 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)

I tried to remove sdk file completely and reinstall as described in b4a product page, only updated the mobile ads sdk again which led to other updates againn and same errors again. What can I do about it?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are not forced to use FirebaseAdmob2 / Mobile Ads v20 for now. So unzip the Android SDK and keep using it without updating anything.

It is not yet clear what causes this error: com.android.dex.DexException: Library dex files are not supported in multi-dex mode
It is probably related to one of the third party libraries.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
You are not forced to use FirebaseAdmob2 / Mobile Ads v20 for now. So unzip the Android SDK and keep using it without updating anything.

It is not yet clear what causes this error: com.android.dex.DexException: Library dex files are not supported in multi-dex mode
It is probably related to one of the third party libraries.
Because of open bidding problems with current version on my app, ad companies suggested to update to latest version of mobile ads. That's why I need to update. Should I disable 3rd party libraries and try that way ? Most of them are internal libraries :/
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Should I disable 3rd party libraries and try that way ?
No.
If I were you, I would personally create a clean minimal project using mobile ads v20. Do this just to see if you can just get that working with absolutely nothing else. It shouldn't take longer than a few minutes integrate...
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
No.
If I were you, I would personally create a clean minimal project using mobile ads v20. Do this just to see if you can just get that working with absolutely nothing else. It shouldn't take longer than a few minutes integrate...
Tried it now, If I reference firebaseadmob 2 library error starts to happen in a clean project that has no more libraries enabled

If I dont enable multidex, this time firebase analytics causes problem :

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

so it means that firebase analytics and firebaseadmob2 cant work together ? Because no other libraires are enabled..
 
Last edited:
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
I'm not able to compile project:
B4X:
B4A Version: 10.70
Parsing code.    (0.00s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (0.06s)
Linking resources    (0.28s)
Compiling generated Java code.    (0.01s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
@Pendrush have you updated the resources with B4A sdk manager?

@Pendrush, @tufanv please make a test. Download a new SDK (the two components). Update the recommended items and try again. Make sure to configure the IDE to use the new SDK.
Sure, first of all this is the file you have asked before changing anything.
 

Attachments

  • installed-components.txt
    12.6 KB · Views: 273
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
After recommended update without MultiDex:

B4X:
B4A Version: 10.70
Parsing code.    (0.00s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.62s)
Linking resources    (0.33s)
Compiling generated Java code.    (1.32s)
Convert byte code - optimized dex.    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)

With MultiDex:
B4X:
B4A Version: 10.70
Parsing code.    (0.00s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.01s)
    (AndroidX SDK)
Compiling resources    (0.06s)
Linking resources    (0.30s)
Compiling generated Java code.    (0.02s)
Convert byte code - optimized 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)
 

Attachments

  • installed-components.txt
    12.5 KB · Views: 291
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
Just Core lib and FirebaseAdMob2 with MultiDex:

B4X:
B4A Version: 10.70
Parsing code.    (0.00s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.01s)
    (AndroidX SDK)
Compiling resources    (0.05s)
Linking resources    (0.27s)
Compiling generated Java code.    (0.77s)
Convert byte code - optimized 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

tufanv

Expert
Licensed User
Longtime User
after recommended updates:
without multidex and firebase admob 2 + analytics
B4X:
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)

with multidex:

B4X:
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 can compile without multidex if only firebase admob 2 is referenced ( firebase analytics not selected)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Search for firebase in the sdk manager and install all results. Clean the project and try again. Does it help?
Getting same results with everything related to firebase updated.I can try everything you need, just tell me please.
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
All Firebase installed:

B4X:
B4A Version: 10.70
Parsing code.    (0.00s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.00s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (0.06s)
Linking resources    (0.29s)
Compiling generated Java code.    (0.79s)
Convert byte code - optimized 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)
 

Attachments

  • installed-components.txt
    15.1 KB · Views: 281
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
I'm not able to install Firebase BoM, all other installed and updated.
B4X:
Downloading: https://dl.google.com/dl/android/maven2/master-index.xml
Downloading: https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-bom/27.0.0/firebase-bom-27.0.0.pom
Downloading: https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-bom/27.0.0/firebase-bom-27.0.0.jar
 <title>Error 404 (Not Found)!!1</title>
 
Upvote 0
Status
Not open for further replies.
Top