iOS Build Environment Help Center

libswiftAVFoundation dependency in Facebook SDK?

append delete TopCog

Windows 10
Unity 2021.3.19f1
Builder 3.41.1
iOS SDK 15

----------------

Hey, long-timer user of the builder here! Been deploying games to iOS for years, and 2 years now using your product...

Right now though, I'm unable to get a successful build with Facebook. If I remove Facebook from the project, it builds. I'm using the FB sdk 11.0, and have tried with all 11.x versions of the static frameworks. The build log is here: https://pastebin.com/Jr6X3WCj and the relevant failure is:

Warning: dependency libswiftAVFoundation is not among the built products. Looking for a precompiled binary...
ERROR: embedded dependency depends on unidentified library or framework: libswiftAVFoundation

I've exhausted all ideas I have, any help would be appreciated. Thanks!

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

That’s one curious dependency indeed. Could you please send me that Xcode project (or a stubbed one that exhibits the same problem) along with the Facebook SDK that you use, to my email address ? Confidentiality is guaranteed. I need to study that more closely.

append delete #2. Pierre-Marie Baty

I had a chance to look at what you sent me. Your game builds and appears to work with just the IronSource SDK tied in. It doesn't seem to require Facebook at all, does it ? Is it the expected behaviour ?

As the Facebook SDK is made of many different frameworks, I won't be adding all of them just for the sake of seeing if they fit, especially if your code doesn't use them.

I would suggest to :

1. Add the code that requires the Facebook SDK in your game
2. Build and see which framework(s) are missing
3. Add just the missing frameworks from the Facebook SDK
4. Goto 2., repeat until no more errors.

Or maybe I missed something ?

append delete #3. Pierre-Marie Baty

Just as I'm thinking about it again, if the problem appears again, try adding:

% extra linker flags
-L/usr/lib/swift
%

to the extra linker flags and let me know if it solves it.

append delete #4. TopCog

It looks like the build that I made for you didn't have Facebook features enabled; I had just written a compatibility manager to let me turn these kinds of features on and off, but it was bugged. My apologies! I rebuilt the package after ensuring that the Facebook features were enabled. I just checked, and verified that the new build does not build without the frameworks. I'll send this over shortly. Thanks!

Just saw your latest message: I just tried that, and the same error occurred.

append delete #5. Pierre-Marie Baty

I could build, deploy and run your game with the Facebook SDK.

My settings:
builder version 3.42
iOS SDK version 15.0

% Extra compiler flags (UnityFramework)
-F"I:/3rdPartySDKs/IronSource.xcframework/ios-arm64_armv7" -F"I:/3rdPartySDKs/FacebookSDK_Static"
%
% Extra linker flags (UnityFramework)
-F"I:/3rdPartySDKs" -framework IronSource -F"I:/3rdPartySDKs/FacebookSDK_Static" -framework FBSDKCoreKit -framework FBSDKShareKit -framework FBSDKLoginKit -framework LegacyGamingServices -framework Accelerate
%

As you may have noticed, with this new version of the builder (3.42), you have the ability to specify compiler and linker flags that are specific to a particular Xcode build target. This avoids the "duplicated classes" problem and creates smaller executables. In your situation (and almost all situations), the extra compiler and linker flags concern the Unity engine, so they should be added to the "UnityFramework" target only and not the app launcher one.

As for the app itself, it builds and deploys fine on my iPhone. When launched, after the loading screen a green map is shown and some music is played. The debug console messages show nothing unusual.

Let me know if you can reproduce this please.

append delete #6. TopCog

Yes! I finally got a successful build.

At first, it was giving me the same error. Then, I copied your linker flags exactly, and noticed that you didn't have the "-ObjC" flag. After that, it built without error.

I had put that flag in originally because the IronSource docs said it was needed for their framework to function. What a simple solution in the end.

Thanks for your persistence in helping me out! I use the Facebook sdk for marketing and account management purposes, so this is great. Cheers! :-)

append delete #7. Pierre-Marie Baty

If they say it’s needed, it either should be there for a yet to be discovered reason, or they are mistaken.

Does your app behave totally normally ? Do all the features you need from these frameworks work ?

append delete #8. TopCog

Blast - you are right. I was hasty in thinking that a successful build meant all was well:

I tried back-to-back builds after removing Facebook, and IronSource only works with the -ObjC linker flag.

:: @TopCog added on 09 Dec ’21 · 13:42

Actually. Let me confirm this is the case with some more testing. This could be a false flag.

:: @TopCog added on 09 Dec ’21 · 14:41

Can confirm: the IronSource adapter is not receiving callbacks without the -ObjC linker flag.

append delete #9. Pierre-Marie Baty

I found the issue and I'm working on it. The IronSource framework wants to embed the Swift 5.0 standard libraries with the app and expects them to be within the app directory at runtime.

append delete #10. Pierre-Marie Baty

Version 3.43 is uploading right now and should hopefully fix the problem. Please let me know.

append delete #11. TopCog

Should I be building with the -ObjC linker flag? I get a similar error as before when using the flag:

https://pastebin.com/TSLZK1R2

Let me know!

append delete #12. Pierre-Marie Baty

Yes you should. Have I goofed my upload ? Let me see…

:: @Pierre-Marie Baty added on 11 Dec ’21 · 14:19

*edit* looks like everything is correct... Here are the flags I used:

% extra compiler flags
-F"I:/3rdPartySDKs/IronSource.xcframework/ios-arm64_armv7" -F"I:/3rdPartySDKs/FacebookSDK_Static"
%
% extra linker flags
-F"I:/3rdPartySDKs" -framework IronSource -F"I:/3rdPartySDKs/FacebookSDK_Static" -framework FBSDKCoreKit -framework FBSDKShareKit -framework FBSDKLoginKit -framework LegacyGamingServices -framework Accelerate -ObjC
%

Can't you reproduce a successful build ? Maybe you just need to tick "rebuild all"

append delete #13. TopCog

I'm wrapped up in a lot of work right now, but I hope to test it again this week. I'll let you know the results!

append delete #14. Pierre-Marie Baty

Any news ? Can I consider the problem solved ?

append delete #15. TopCog

No news yet, apologies. The game released on iOS last week and Steam this week, to more than expected popularity - I've been insanely busy putting out fires! I'll post here again once I have some news.

append delete #16. Pierre-Marie Baty

Well, congratulations :)

append delete #17. Sokharev

Same Here. I've found root of problem. Latest 'Migration assistant (step 1, Mac).command'
have commented block(not sure why - perhaps mistake) :

## step 4
#echo ""
#echo -n "Step 4. Zipping the Swift standard libraries from $(basename "${XCTCHAIN_PATH}")..."
#cd "${XCTCHAIN_PATH}/usr/lib"
## with symlinks: zip -uryq
#zip -urq "${OUTFILE}" "swift-5.0/iphoneos" || ( echo ""; echo "Looks like there's not enough space on your USB key."; echo "Please try again with a key with at least ${REQUIRED_SPACE} free."; rm -f "${LOCKFILE}"; exit; )
#echo "done."

====
This causes skipped 'swift-5.0' folder in SDK path. you need to uncomment lines with cd/zip lines( or entire block ) => voila you'll have 101mb zip instead of just 32mb.
After that new FB Sdk static 11.0 works as usual.
I'am using xcode 13.1, ios sdk 15 used from Scaleway ( pretty convinient to get SDK from ).

append delete #18. Pierre-Marie Baty

You are totally right and I apologize for my mistake. It appeared that the migration assistant script that I bundled with the last installer was no longer in sync with my working copy. The next version 3.44 will solve that. I'm glad you pointed me at the problem. Thank you !

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty