facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
487 stars 257 forks source link

Adding use_frameworks! to the Podfile is provoking a crash on app launch #510

Open polmum opened 3 years ago

polmum commented 3 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

Build my app for iOS.

Expected Results

App builds and runs correctly.

Actual Results

Crashes on runtime:

Error loading [path]/Test2020.app/Frameworks/UnityFramework.framework/UnityFramework:  
  dlopen([path]/Test2020.app/Frameworks/UnityFramework.framework/UnityFramework, 265): 
     Library not loaded: @rpath/CASPromo.framework/CASPromo
  Referenced from: [path]/Test2020.app/Frameworks/UnityFramework.framework/UnityFramework
  Reason: image not found

Code Samples & Details

This is happening because of the use of use_frameworks! when creating the Podfile, added by Facebook in this post process.

Removing use_frameworks! from the Podfile fixes the issue, so I'm not really sure why it is being added by Facebook. At the very least, I think this should be optional and not mandatory. I think forcing the usage of use_frameworks! is a little invasive.

This has also affected other SDKs, like Firebase: https://github.com/firebase/quickstart-unity/issues/862

CodeMasterYi commented 3 years ago

use_frameworks! conflicts with some other SDK such as MoPub.

polmum commented 3 years ago

Hey! Any news on this? The External Dependency Manager for Unity just added an option to add use_frameworks! in the Podfile, true by default, here: https://github.com/googlesamples/unity-jar-resolver/commit/256994f1b51d5a8d7c7679a77926fdb9eb40e037

I really think Facebook should not be adding use_frameworks! in a post process, and should rely on this new configuration.

jjfmarket commented 2 years ago

We are using use_frameworks! :linkage => :static in our project to statically link the pods, but this build step inserts use_frameworks! regardless and overrides the setting that we want. We end up having to go end edit the file to remove the statement in a post build step immediately after this runs.