# Implementing ads with admob

**URL:** https://discourse.processing.org/t/implementing-ads-with-admob/2935
**Category:** Processing for Android
**Created:** [August 24, 2018, 6:12pm UTC](https://discourse.processing.org/t/implementing-ads-with-admob/2935 "2018-08-24T18:12:08Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![MatterLinx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matterlinx/32/3121_2.png) [@MatterLinx](https://discourse.processing.org/u/MatterLinx)
#### Post date: [October 22, 2018, 10:29pm UTC](https://discourse.processing.org/t/implementing-ads-with-admob/2935/6 "2018-10-22T22:29:25Z")

</div>

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:

```auto
: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!

---

_[View the full topic](https://discourse.processing.org/t/implementing-ads-with-admob/2935)._
