AppLovin / AppLovin-MAX-Unity-Plugin

123 stars 33 forks source link

AppLovinMediationFyberAdapter 8.2.0.0 (DT Exchange) causes crash on launch for iOS #240

Closed AntonPetrov83 closed 1 year ago

AntonPetrov83 commented 1 year ago

MAX Plugin Version

5.8.2

Unity Version

2020.3.43f1

Device/Platform Info

iOS

Current Behavior

App crashes on launch with the error:

Error loading /var/containers/Bundle/Application/.../Frameworks/UnityFramework.framework/UnityFramework:  
    dlopen(/var/containers/Bundle/Application/.../Frameworks/UnityFramework.framework/UnityFramework, 0x0109):
    dependent dylib '@rpath/IASDKCore.framework/IASDKCore' not found for '/private/var/containers/Bundle/Application/.../Frameworks/UnityFramework.framework/UnityFramework'.
    relative file paths not allowed '@rpath/IASDKCore.framework/IASDKCore'

Expected Behavior

No crash on start.

How to Reproduce

Build iOS app with the specified SDK versions.

Additional Info

Not reproducible with AppLovinMediationFyberAdapter 8.1.4.0

santoshbagadi commented 1 year ago

Hi @AntonPetrov83 , we’ve released a fix for this in our latest plugin version 5.8.3.

cometa93 commented 1 year ago

@santoshbagadi, I've built app with the version 5.8.3 I confirm I do have the code: image image

I've built clean build, with no build stored in derived data.

Pod clean project, everything from scratch and still build throwing same error with the crash. any solution? Did you tested it out?

I do confirm that, there is IASDKCore placed within Fyber_Marketplace_SDK/Frameworks/IASDKCore.xcframework in the Pods project

santoshbagadi commented 1 year ago

@cometa93 , do you mind sharing the Podfile of the exported project. We have tested these changes and we don't see the crash at launch anymore.

AntonPetrov83 commented 1 year ago

Updated everything to latest versions lately: Max SDK iOS 11.11.2, Xcode 14.3.1 and the bug is 100% reproducible.

A crash on the launch with a log message:

<Error>: Error loading /var/containers/Bundle/Application/8EDFADB8-C7CF-45FB-A60B-C2EB3710B0F8/Gladiators.app/Frameworks/UnityFramework.framework/UnityFramework (137):  dlopen(/var/containers/Bundle/Application/8EDFADB8-C7CF-45FB-A60B-C2EB3710B0F8/Gladiators.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/IASDKCore.framework/IASDKCore
  Referenced from: <4C79EAA1-BBAF-37A5-9D90-6FDF7575AA1D> /private/var/containers/Bundle/Application/8EDFADB8-C7CF-45FB-A60B-C2EB3710B0F8/Gladiators.app/Fram
eworks/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), '/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/8EDFADB8-C7CF-45FB-A60B-C2EB3710B0F8<\M-b\M^@\M-&>
santoshbagadi commented 1 year ago

@AntonPetrov83 do you mind sharing the generated Podfile of the exported project.

AntonPetrov83 commented 1 year ago

@santoshbagadi This is related to #275 . As I understand the problem is Fyber links IASDKCore as a static library but somehow due to use_frameworks! in a Podfile it is expected to be a dynamically linked library.

Someone should ask Fyber to change the way they implement dependency on IASDKCore ))) Either it should be a seperate pod or a part of their SDK's source tree.

AntonPetrov83 commented 8 months ago

FYI: Following Max SDK integration guides and unchecking Add use_frameworks! to Podfile and Always add the main target to Podfile solves the issue but I faced another issue then with the Firebase SDK.

The error was:

[!] 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.

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>