[Solved] [LibGDX] RevMob ads integration throwing a NullPointerException.

Hello everyone. I’m trying to incorporate RevMob ads into the Android version of my game.

I’ve followed several articles and tutorials on it, and they all give the same issue. I’ve tried doing it myself a little differently, still the same issue.

I don’t know if these articles are just out of date or something, but on RevMob’s SDK documentation, you have to handle the EULA being shown and then being accepted or rejected, none of these articles even mention anything about that, so I don’t know if it’s supposed to just happen somehow or if it just wasn’t an issue at the time.

That actual error from Logcat is a NullPointerException at com.revmob.RevMob.start(RevMob.java:104)

I don’t have anyway to see what’s actually happening in the RevMob code, and I can’t figure out what exactly is null because of this.

I’ve tried running startWithListener thinking that the listener was null for some reason, but that still didn’t work. I’m not really sure what to do here, the game just crashes right when you try to open it, and I’m convinced it’s a problem with the EULA not being handled.

Nevermind I have solved this myself.

Apparently the Application’s ID was null. According to RevMob’s SDK putting a meta tag in the manifest with the application ID is all you need to do, this apparently is not so.

I had to use RevMob.startWithListenerForWrapper(activity, app_id, listener) and then it worked.