0

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

  • Does this answer your question? ["unrecognized selector sent to instance" error in Objective-C](https://stackoverflow.com/questions/2455161/unrecognized-selector-sent-to-instance-error-in-objective-c) – stackich Nov 15 '22 at 09:36
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Nov 15 '22 at 12:40

1 Answers1

1

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