Hi,
I was hoping to include ads in a small game I'm working on at the moment but I'm having some trouble getting it working. Unfortunately there doesn't seem to be much information online about getting ads working in a processing sketch for Android. I've exported my processing sketch and opened it in Android studio. I then followed the instructions on Google's new Firebase assistant for AdMob, but I'm getting errors when I try to run the app.
FATAL EXCEPTION: main
Process: processing.test.sketch_161212b, PID: 26425
java.lang.RuntimeException: Unable to start activity
ComponentInfo{processing.test.sketch_161212b/processing.test.sketch_161212b.MainActivity}:
android.content.res.Resources$NotFoundException:
Unable to find resource ID #0x1000
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5470)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1000
at android.content.res.Resources.getResourceName(Resources.java:2364)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:968)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
at android.app.BackStackRecord.run(BackStackRecord.java:794)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535)
at android.app.FragmentController.execPendingActions(FragmentController.java:325)
at android.app.Activity.performStart(Activity.java:6267)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5470)
at java.lang.reflect.Method.invoke(Native Method)
The game runs fine in Android studio without the ads. All I've done was followed the instructions provided in Android studio under Tools > Firebase > AdMob and edited the xml files and MainActivity as it tells you to do.
Any suggestions?