Implementing ads with admob


#1

Hello everyone,

I followed these tutorials to add admob ads to my processing sketch:

https://forum.processing.org/two/discussion/16686/how-to-add-admob

I couldn’t put the second link here because of new user limitations but the title is: What are the exact steps to add AdMob to my app?

Thanks to akenaton and randomdude for your huge help.

My problem is that the ad doesn’t show up, the sketch launches on my device but there is no ad and I get this message:

BUILD SUCCESSFUL in 1m 6s
29 actionable tasks: 29 executed
[socket][0] connection pagead2.googlesyndication.com/2a00:1450:400d:803::2002:443;LocalPort=-1(60000)
[socket][/2001:4c4c:1163:e600:d864:c1d3:1814:1019:56794] connected
[OkHttp] sendRequest>>
[OkHttp] sendRequest<<
Wrong owner. Perhaps a late disconnect
close [socket][/2001:4c4c:1163:e600:d864:c1d3:1814:1019:56794]

Can somebody help me? Should I provide any of the source files?


Using admob ads in processing
#2

Now it works. The problem was just a stupid mistake. I copied the wrong admob sample id.:flushed:


#3

Great. Thxs for updating your post.

Kf


#4

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!

Thank you in advance


#5

https://drive.google.com/file/d/106YJchXlfUjKt_lB5Uw7GHKKLfmYCSzH/view?usp=sharing

Try this. It’s made from the two discussions I linked.


#6

Thanks for the code.

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?

If anyone knows how to solve this, please help!


#7

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.


#8

Can you link the edited jar file?

Edit: Never mind, everything is working now

Thanks for the help.


#9

Boti, could you please add the modified jar file?, please