AppLovin / AppLovin-MAX-SDK-iOS

84 stars 69 forks source link

Xcode 15.2 + 15.3 start app crashing [NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil #310

Closed abinhho closed 1 month ago

abinhho commented 1 month ago

MAX SDK Version

12.4.0 + 12.3.0

pod 'AppLovinSDK'

Device/Platform Info

Xcode 15.3, 15.2, 15.1, 15.0.1

Current Behavior

App crashing after launched. Screenshot 2024-04-03 at 10 07 24

Expected Behavior

App should not crashing

How to Reproduce

    let sdk = ALSdk.shared()

    if sdk.isInitialized == true {
        return
    }

    // CCPA
    ALPrivacySettings.setDoNotSell(true)  // Set to 'true' if you want to apply "Do Not Sell"

    // Child-directed setting (COPPA)
    ALPrivacySettings.setIsAgeRestrictedUser(false) // Set to 'true' if the app is child-directed.

    // GDPR Consent
    if ALPrivacySettings.isAgeRestrictedUser() {
        ALPrivacySettings.setHasUserConsent(false)
    } else {
        ALPrivacySettings.setHasUserConsent(true)
    }

    let initConfig = ALSdkInitializationConfiguration(sdkKey: AdsConfigs.APPLOVIN_SDK_KEY) { builder in
        builder.mediationProvider = "max"
    }

    // initConfig.exce = false

    // To disable all log, enable this
    // sdk?.settings.setExtraParameterForKey("disable_all_logs", value: "true")

    // Finally, initialize the SDK
    sdk.initialize(with: initConfig) { _ in }

Additional Info

Already clean build, restart Xcode, tried with Xcode 15.2, 15.3 but still getting crash.

thomasmso commented 1 month ago

Hi @abinhho - thanks for raising this issue. Do you mind removing the AppLovinSdkKey from your app's Info.plist and trying again?

abinhho commented 1 month ago

@thomasmso Thanks for your feed back. Actually I don't have AppLovinSdkKey on Info.plist

christophercong commented 1 month ago

@abinhho how are you integrating our SDK? Is it through CocoaPods or SPM?

abinhho commented 1 month ago

@abinhho how are you integrating our SDK? Is it through CocoaPods or SPM?

I am using CocoaPods.

christophercong commented 1 month ago

@abinhho can you provide your device logs and/or the stack trace?

thomasmso commented 1 month ago

@abinhho - If you disable exception breakpoints, does the issue still occur? I'm not saying that would be the solution, as exception breakpoints are a necessity for development, but just want to understand your issue better.

christophercong commented 1 month ago

@abinhho can you also confirm that you are on SDK version 12.4.0 (if you can, can you provide your Podfile.lock)? There is a log missing from the ALSdkInitializationConfiguration on init that we added.

abinhho commented 1 month ago

@thomasmso

It seems app can run after disable exception breakpoints but I am not sure any issue else.

[AppLovinSdk] DEBUG [AppLovinSdk] 
========================================
=====AppLovin SDK=====
===SDK Versions===
Version: 12.3.0
Plugin Version: 12.3.0.0
Ad Review Version: 
OM SDK Version: 1.4.12-Applovin
===Device Info===
OS: iOS 17.3.1
IDFA: <Enable verbose logging to see the IDFA to use for test devices - https://monetization-support.applovin.com/hc/en-us/articles/236114328-How-can-I-expose-verbose-logging-for-the-SDK>
IDFV: <Enable verbose logging to see the IDFV to use for test devices - https://monetization-support.applovin.com/hc/en-us/articles/236114328-How-can-I-expose-verbose-logging-for-the-SDK>
Model: iPhone11,2
Locale: vi_JP
Simulator: 0
Tablet: 0
===App Info===
Bundle ID: com.sango.widgetphoto
Has AppLovinSDKResources: true
NSAdvertisingAttributionReportEndpoint: https://appsflyer-skadnetwork.com/
===SDK Settings===
SDK Key: xxx
Mediation Provider: admob
TG: 99
AEI: 96
MEI: 127
MD: FR4p/xxxx
Test Mode On: false
Verbose Logging On: false
===Privacy States===
Please review AppLovin MAX documentation to be compliant with regional privacy policies.

Age Restricted User - false
Has User Consent - true
"Do Not Sell" - true
===App Tracking Transparency===
Authorization Status: Authorized (3)
NSUserTrackingUsageDescription Exists: true
===MAX Terms Flow===
Enabled: false
Privacy Policy URL: https://cccxx.fun/privacy-policy/
Terms of Service URL: https://cccxxx.fun/term-of-service/
===CMP (Consent Management Platform)===

CMP Name - Google LLC CMP
CMP SDK ID - 300
CMP SDK Version - No value set
IABTCF_gdprApplies - 0
IABTCF_TCString - No value set
IABTCF_AddtlConsent - No value set
========================================
AppLovinAdapter: All SDKs completed initialization.
AppLovinAdapter: AppLovin adapter version: 12.3.0.0
AppLovinAdapter: AppLovin SDK version: 12.3.0
christophercong commented 1 month ago

@abinhho there seems to be a mismatch somewhere here. The logs indicate 12.3.0, however the Podfile.lock indicates 12.4.0. Can you double check you have your workspace, pod, and project clean and up to date? One thing you could try is to delete your current Podfile.lock and run pod install --repo-update again.

abinhho commented 1 month ago

@thomasmso @christophercong Actually I tried to switch 12.3.0 and 12.4.0 but both versions are getting the same issue. That why you can see sometime 12.3.0 and sometime 12.4.0

abinhho commented 1 month ago

I tried

// deleted Podfile.lock
pod deintegrate
pod install --repo-update

Also tried

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

Also tried

One thing strange is I asked 2 co-workers trying to build on XCode 15.3 and both of them can run successfully. Only me getting this issue.

abinhho commented 1 month ago

@abinhho can you also confirm that you are on SDK version 12.4.0 (if you can, can you provide your Podfile.lock)? There is a log missing from the ALSdkInitializationConfiguration on init that we added.

I tried to delete XCode and install new one but not resolve the issue. Log of ALSdkInitializationConfiguration here but still getting crash.

Screenshot 2024-04-03 at 16 12 41

abinhho commented 1 month ago

@thomasmso @christophercong After removed directory MyApp.xcodeproj/xcuserdata and MyApp.xcworkspace/xcuserdata then it works now. I guess AppLovinSdkKey stored there but I am not sure.

Thank you all for your time.