googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[Bug] iOS build fails - Admob Mediation Adapters are not compatible with Facebook SDK #619

Closed Davidnovarro closed 1 year ago

Davidnovarro commented 1 year ago

My project uses Facebook SDK (for signing-in etc..) and Google Moblie Ads SDK with mediation adapters, the problem is that mediation adapters (Applovin 6.7.0 for example) work only when "Link Frameworks Statically" is set to true, but in that case, the game crashes because of Facebook SDK.

In case static "Link Frameworks Statically" is set to true Xcode build succeeds, but the app crashes at lunch with these exceptions: (Full Crash Log)

Library not loaded: @rpath/FBAEMKit.framework/FBAEMKit
'/System/Library/Frameworks/FBAEMKit.framework/FBAEMKit' (no such file, not in dyld cache)

In case static "Link Frameworks Statically" is set to false the Xcode fails to build with these exceptions: (Screenshot)

Undefined symbol: _CGSizeFromGADAdSize
Undefined symbol: _GADAdSizeFromCGSize
Undefined symbol: _GADClosestValidSizeForAdSizes
Undefined symbol: _NSStringFromGADAdSize
Undefined symbol: _NSValueFromGADAdSize
Linker command failed with exit code 1 (use -v to see invocation)

Versions:

Unity Engine: 2021.3.25f1
External Dependency Manager: 1.2.176
Facebook SD: 16.0.0
Google Mobile Ads: 8.2.0
Applovin Mediation Adapter: 6.7.0
Xcode: 14.3
CocoaPods: 1.12.1

I want to mention that if I remove the Applovin adapter the build works correctly when Link Frameworks Statically is set to false. It also works as expected when the Link Frameworks Statically is set to true but FB SDK is removed.

Steps to reproduce:

1) Download the minimal sample project that I've made from here: (Project Link) 2) Try o build with Xcode and run it on a device

paulinon commented 1 year ago

Hi @Davidnovarro,

Thanks for bringing this to our attention. I was able to replicate the issue using the steps you provided. Let me relay my observations to the team. That said, I'll be marking this as a bug, and you may refer to this thread for updates.

Davidnovarro commented 1 year ago

said

Thanks @paulinon for your response, while this issue is being addressed could you suggest a workaround? I'm trying to find a way to link FB frameworks as dynamic and all the others as static, but still no luck.

paulinon commented 1 year ago

Hi @Davidnovarro,

I brought this up to the team, and it turns out that the cause of this behavior lies within the Facebook SDK. It's possible that it contains the code to force add use_frameworks! in your Podfile regardless of EDM4U settings. This forces your framework to always be linked dynamically. That said, you may raise this in the Facebook SDK for Unity GitHub repository as they have the proper resources and tools that enable them to get a closer look at the issue you've encountered.