An error occurs when adding InMobi in AdMob Mediation

699 Views Asked by At

The following error will appear when I add in InMobi iOS:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IMAdView initWithFrame:imAppId:imAdUnit:rootViewController:]: unrecognized selector sent to instance 0xb9e2080'

I have the following:

・ AdMob Mediation SDK add
・ InMobi adapter and SDK add
・ Other Linker Flags add -ObjC and -all_load**

Still missing something? Do you need or import?

2

There are 2 best solutions below

2
On

It looks like you aren't calling this method on a proper IMAdView object. As per the documentation, this works:

IMAdView *someAdView = [[IMAdView alloc] initWithFrame:CGRectMake(0, 0, 320, 50) imAppId:@"YOUR_INMOBI_APP_ID" imAdSize:IM_UNIT_320x50 rootViewController:self];

You have to allocate an object with alloc before initializing it.

0
On

I had this problem, too, when I updated my Google AdMob SDK to ver 6.4.2, and the InMobiAdMobiOSAdapter, to whatever the latest version is, but neglected to update the inMobi SDK to 3.7.0.

On this page: https://developers.google.com/mobile-ads-sdk/docs/admob/mediation-networks look at the row for InMobi. You have to download both the adapter("adapter for iOS") and the SDK ("Download iOS"), and incorporate them into your project.