Android Question Error compile after use new AdMob

susu

Well-Known Member
Licensed User
Longtime User
Hi, I recently update my app with new AdMob. I follow all steps in tutorial:
- Update Google Play Service then add google play jar file to Additional Libs Folder.
- Update AdMob lib to 2.0.
- Add #AdditionalRes: D:\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
- Add AddApplicationText( ........ ) in menifest.
- Change AdMob ID to the new one "ca-app-pub-XXXXXXXXXXXXXXX".
- Path configuration:
Javac.exe C:\Program Files (x86)\Java\jdk1.8.0_25\bin\javac.exe
Android.jar D:\android-sdk\platforms\android-19\android.jar
- I'm using B4A 5.02(1) on Windows 10.

The error is:
B4X:
Convert byte code - optimized dex.    Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest$ErrorCode;
    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:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    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:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting

I try to Clean Project but no luck too.
 

susu

Well-Known Member
Licensed User
Longtime User
Can I know which library that includes AdMob classes?

libs.jpg
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
If the problem is mwAdmobInterstital, how can I use both of them? Or my question will be "Will you add Interstitial ads support to AdMob library" ?
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
I disable mwAdmobInterstital and I can compile but when I open my app there's another error like screenshot.
I'm using Google Play Service Rev 25 and AdMob v2.0.

Screenshot_2015-08-06-20-58-05.jpg
 
Upvote 0
Top