Hello, I’ve been having trouble with implementing admobs. If it isn’t too much trouble, I would appreciate it if you could link a project file of a blank sketch with just a banner ad. I’m not sure if the issue likes in my manifest, in the imported library, or because of some thing else. In any case, a project file would be really helpful to me!
The project built just fine, and it installed no problem. On it’s own, the sketch launched, and I could see the test ad. Unfortunately, after adding my game, I got this error:
:app:transformDexArchiveWithDexMergerForDebugDex: The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
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.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
FAILED
I don’t understand why i’m getting this issue, because I have nowhere near 65536 methods in my sketch. Did you encounter this issue as well?
Oh yes, sorry, I had that problem too for a few days. Just delete some files which are not needed from the com/google/android/gms folder in the jar file. You can try out what is the minimum needed for ads (I already did that, I can send you the smaller jar tomorrow if you need it). I just kept these files because maybe we will need something in the future for other stuff.
I came here to link an example project with working ads, but my old projects compile with errors now… I also never got the interstitial ads to work properly.
Also, this game (Come Play My Game!) that I released has rendering issues on some devices, so processing isn’t really a great solution if you want to make mobile games.
I suggest trying out Unity as an alternative, they make the integration of ads much easier.