iosswiftadsapplovin

I got Crash when integrating Applovin Max Ad iOS


I am trying to integrate Applovin Ad into my project. But I get a crash when trying to integrate

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM al_isValidString]: unrecognized selector sent to instance 0x28116aa30'

Below is my code:

ALSdk.shared()!.mediationProvider = ALMediationProviderMAX ALSdk.shared()!.initializeSdk(completionHandler: { _ in })

I tried creating new project and it works. But on my project still Crash. My project integrates admob, iron ads and applovin


Solution

  • I found the error at this line

    ALSdk.shared()!.mediationProvider = ALMediationProviderMAX
    

    I use Cocoapods to install

    pod 'AppLovinSDK'
    

    It creates 2 paths to that file. But when I click on it, it still only points to 1 file

    See this photo to know more

    That makes xcode not know which file's func to use. And generate the above error. Hope this helps everyone