Implementing ads with admob

Hello everyone,

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

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:

29 actionable tasks: 29 executed
[socket][0] connection;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?

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

Great. Thxs for updating your post.


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

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

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
    UNEXPECTED TOP-LEVEL EXCEPTION: method ID not in [0, 0xffff]: 65536 method ID not in [0, 0xffff]: 65536
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(
	at java.util.concurrent.ForkJoinTask.doExec(
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(
	at java.util.concurrent.ForkJoinPool.runWorker(

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!

1 Like

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.

Can you link the edited jar file?

Edit: Never mind, everything is working now

Thanks for the help.

Boti, could you please add the modified jar file?, please could i implement video ads through processing for android? Please help

Hey .i have the same error integrating with my game…i tried implementing video ads for 1 week and failed … at least i want to implement

Hey guys,

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.

Hope this helps!