AppLovin / AppLovin-MAX-Unity-Plugin

130 stars 35 forks source link

Crash on startup in iOS and xcode 14 #275

Closed uchar closed 1 year ago

uchar commented 1 year ago

MAX Plugin Version

5.11.2

Unity Version

2021.3.29

Device/Platform Info

iOS 16

Current Behavior

Recently, after updating applovin to the latest version with all plugins updated and also Xcode to the latest version (14.3.1), the game builds fine but we get this crash in the startup :

2023-08-13 13:03:36.495784+0330 ....[3234:2256835] AppLovinQualityService top: AppLovinQualityService Client Version: 6.12.3

2023-08-13 13:03:36.495837+0330 ....[3234:2256835] AppLovinQualityService top: AppLovinQualityService Device ID: AC472DDB-0BA9-4841-A610-F89CEBE2379E

2023-08-13 13:03:36.592767+0330 ....[3234:2256835] [general] Error loading /var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework (137):  dlopen(/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/IASDKCore.framework/IASDKCore

  Referenced from: <38587096-2208-3963-B8B9-F16AE2E1D68F> /private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework

  Reason: tried: '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/System/Library/Frameworks/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache)

2023-08-13 13:03:36.625290+0330 ....[3234:2256835] [general] Error loading /var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework (137):  dlopen(/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/IASDKCore.framework/IASDKCore

  Referenced from: <38587096-2208-3963-B8B9-F16AE2E1D68F> /private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/UnityFramework.framework/UnityFramework

  Reason: tried: '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/private/var/containers/Bundle/Application/99CBFA94-E313-465B-9C61-C952A670B703/.....app/Frameworks/IASDKCore.framework/IASDKCore' (no such file), '/System/Library/Frameworks/IASDKCore.framework/IASDKCore' (no such file, not in dyld cache)

Also if we uncheck Link frameworks statically in iOS resolver settings ( because some solutions on the internet suggest doing it )

image

We get the following error :

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsPlatformDescription'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsAnalytics'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsLogging'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsBase'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsSDKConfiguration'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsFeatureFlags'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsBaseUI'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsNetworking'

ld: warning: Could not find or use auto-linked framework 'YXMobileAdsDependenciesUmbrella'

Undefined symbols for architecture arm64:

  "_GADAdLoaderAdTypeNative", referenced from:

      ___73-[ALGoogleMediationAdapter loadAdViewAdForParameters:adFormat:andNotify:]_block_invoke in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

      ___64-[ALGoogleMediationAdapter loadNativeAdForParameters:andNotify:]_block_invoke in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_GADAdSizeBanner", referenced from:

      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_GADAdSizeLeaderboard", referenced from:

      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_GADAdSizeMediumRectangle", referenced from:

      -[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:] in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth", referenced from:

      ___75-[ALGoogleMediationAdapter adSizeFromAdFormat:isAdaptiveBanner:parameters:]_block_invoke in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

      +[ALGoogleMediationAdapter currentOrientationAchoredAdaptiveBannerSizeWithWidth:] in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_GADGetStringFromVersionNumber", referenced from:

      -[ALGoogleMediationAdapter SDKVersion] in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADAdLoader", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADAppOpenAd", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADBannerView", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADExtras", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADExtrasBridge)

  "_OBJC_CLASS_$_GADInterstitialAd", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADInterstitialAdBridgeV8)

  "_OBJC_CLASS_$_GADMediaView", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleNativeAdDelegate.o)

      objc-class-ref in libGoogleAdapter.a(ALGoogleNativeAd.o)

      objc-class-ref in libGoogleAdapter.a(ALGoogleNativeAdViewDelegate.o)

  "_OBJC_CLASS_$_GADMobileAds", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADMobileAdsBridge)

  "_OBJC_CLASS_$_GADNativeAdImageAdLoaderOptions", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADNativeAdView", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleNativeAd.o)

      objc-class-ref in libGoogleAdapter.a(ALGoogleNativeAdViewDelegate.o)

  "_OBJC_CLASS_$_GADNativeAdViewAdOptions", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

  "_OBJC_CLASS_$_GADQueryInfo", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADQueryInfoBridge)

  "_OBJC_CLASS_$_GADRequest", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADRequestBridge, _OBJC_CLASS_$_GADRequestBridgeV85 )

  "_OBJC_CLASS_$_GADRewardedAd", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

     (maybe you meant: _OBJC_CLASS_$_GADRewardedAdBridge, _OBJC_CLASS_$_GADRewardedAdBridgeV8 )

  "_OBJC_CLASS_$_GADRewardedInterstitialAd", referenced from:

      objc-class-ref in libGoogleAdapter.a(ALGoogleMediationAdapter.o)

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Expected Behavior

Game should build and run fine

How to Reproduce

In Unity 2021.3.29 add networks from the screenshot below and then try to build it using code 14.3.1 and then run it on iOS 16 ( it also happens on lower version e.g iOS 15)

image

image

Additional Info

No response

JonathanLiuApp commented 1 year ago

Are Add use_frameworks! to Podfile and Always add the main target to Podfile unchecked in the External Dependency manager? If not, could you try unchecking them and rebuilding the project?

uchar commented 1 year ago

Hi @JonathanLiuApp , with :

I get this build error :

No such module ‘FBSDKCoreKit’
JonathanLiuApp commented 1 year ago

Hi @uchar, could you check to make sure that FBSDKCoreKit is in your podfile and there are no cocoapods errors when running pod install? You may need to increase your minimum deployment target for the latest versions of FBSDKCoreKit. You can change that in Unity by going to Target minimum iOS Version in iOS Player Settings. https://docs.unity3d.com/Manual/class-PlayerSettingsiOS.html

uchar commented 1 year ago

@JonathanLiuApp It didn't work, I increased the target minimum iOS, checked cocoapods , test different combinations of options in the external dependency manager and none of them worked! I finally fixed it by downgrading Facebook SDK from 16.0.1 to 14.1.1

AntonPetrov83 commented 1 year ago

After upgrading to the latest AppLovin version we see the same crash on startup in iOS. But we do not use Facebook SDK.

JonathanLiuApp commented 1 year ago

@AntonPetrov83 Unchecking Add use_frameworks! to Podfile and Always add the main target to Podfile should fix the issue. However, if for some reason you are unable to uncheck them or that doesn't solve the issue, you would need to add the missing framework to the embedded frameworks list of the main target to fix this startup crash.

AntonPetrov83 commented 10 months ago

Unchecking Add use_frameworks! to Podfile and Always add the main target to Podfile leads to an error:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

UPDATE: Did managed to solve this by modifying AppDependencies.xml file of the Firebase adding modular_headers="true" property:

<iosPods>
  <iosPod name="Firebase/Core" version="10.13.0" minTargetSdk="8.0"/>

  <!-- ADD THIS! -->
  <iosPod name="FirebaseCore" modular_headers="true"/>
  <iosPod name="GoogleUtilities" modular_headers="true"/>
</iosPods>