iOS Build Environment Help Center

Facebook problem - swift

append delete cancan

Hello, I have a problem with facebook integration. I've read all the threads about swift topics and tried everything you said but it's not working. I added facebook xcfreameworks manually as add extra freamework. But still I am getting this error.

*Podfile;*
pod 'FBSDKCoreKit', '~> 13.2'
pod 'FBSDKCoreKit_Basics', '~> 13.2'
pod 'FBSDKGamingServicesKit', '~> 13.2'
pod 'FBSDKLoginKit', '~> 13.2'
pod 'FBSDKShareKit', '~> 13.2'

*Error;*
+ [arm64] Compiling Libraries/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift...
error: your project contains code written in the Swift language, but the Swift compiler hasn't been ported to Windows yet.
Possible workarounds:
- If this source file is part of a third-party dependency, look for an Objective-C/C++ only version of that dependency and use it instead.
- If this source file is part of your project itself, rewrite it in C, C++, Objective-C or Objective-C++.

*I need your wisdom. Thank you.*

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Please provide the requested info : builder version, OS version, iOS SDK version, as requested in the forum header.

I am about to upload a new version of the builder which could possibly fix your problem. It has experimental Swift support. Please try with the version 3.57 that I'll be uploading in a few minutes and tell me if you're able to build with that version.

:: @Pierre-Marie Baty added on 26 May ’23 · 17:34

*edit* Version 3.57 uploaded. Please report any issues with the Swift compiler.

append delete #2. cancan

Thank you so much for your reply. I'm trying now. I will share new information with you soon.
builder : 3.57 , clang : 15 , swift 5.8 , ios : 16.4

append delete #3. cancan

*I got new errors.*

+ [arm64] Compiling Libraries\com.hulugames.framework.facebooksdk\FacebookSDK\SDK\Editor\iOS\Swift\FBSDKTournamentUpdater.swift...
+ [arm64] Compiling Libraries\com.hulugames.framework.adjustsdk\Adjust\Runtime\iOS\AdjustUnity.mm...
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKCoreKit'
import FBSDKCoreKit
^
+ [arm64] Compiling Libraries\com.unity.mobile.notifications\Runtime\iOS\Plugins\UnityAppController+Notifications.mm...
+ [arm64] Compiling Libraries\com.unity.ads\Plugins\iOS\UnityAnalyticsWrapper.m...
+ [arm64] Compiling Libraries\com.unity.ads.ios-support\Runtime\Plugins\iOS\Categories\NSInvocation\NSInvocation+Convenience.m...
+ [arm64] Compiling Libraries\com.unity.purchasing\Plugins\UnityPurchasing\iOS\UnityPurchasing.m...
+ [arm64] Compiling Libraries\com.unity.localization\Runtime\Platform\iOS\PreferredLanguages.mm...
+ [arm64] Compiling Libraries\com.unity.ads\Plugins\iOS\UnityAdvertisement.swift...
C:\Users\andi\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:83:20: error: no type named 'DispatchQueue' in module 'Dispatch'
extension Dispatch.DispatchQueue {
^
C:\Users\andi\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:173:20: error: no type named 'DispatchSourceProtocol' in module 'Dispatch'
extension Dispatch.DispatchSourceProtocol {
^
C:\Users\andi\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:202:20: error: no type named 'DispatchSource' in module 'Dispatch'
extension Dispatch.DispatchSource {
^
C:\Users\andi\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:271:20: error: no type named 'DispatchSourceMachSend' in module 'Dispatch'
extension Dispatch.DispatchSourceMachSend {
^
C:\Users\andi\iOS Project Builder for Unity\SDK/usr/lib/swift\Dispatch.swiftmodule\arm64-apple-ios.swiftinterface:282:20: error: no type named 'DispatchSourceMachReceive' in module 'Dispatch'
extension Dispatch.DispatchSourceMachReceive {

append delete #4. Pierre-Marie Baty

You need to migrate the iOS SDK again using the new migration assistants. Some things have changed and you can’t reuse your SDK directory.

append delete #5. cancan

Hi, as you said, I migrate the IOS Sdk with new asistant and rebuild.

*Error;*

+ [arm64] Compiling Libraries\com.hulugames.framework.facebooksdk\FacebookSDK\SDK\Editor\iOS\Swift\FBSDKShareTournamentDialog.swift...
+ [arm64] Compiling Libraries\com.unity.services.core\Runtime\Device\UserIdProviders\NSUserDefaults.mm...
+ [arm64] Compiling Libraries\com.gameanalytics.sdk\Runtime\iOS\GameAnalyticsTopOnHelper.m...
+ [arm64] Compiling Libraries\com.hulugames.framework.sdk\Runtime\Common\NativeShare\iOS\NativeShare.mm...
+ [arm64] Compiling Libraries\com.hulugames.framework.facebooksdk\FacebookSDK\SDK\Editor\iOS\Swift\FBSDKTournamentFetcher.swift...
+ [arm64] Compiling Libraries\com.unity.ads.ios-support\Runtime\Plugins\iOS\Categories\NSInvocation\NSEnumWrapper\UASupportPrimitivesBox.m...
+ [arm64] Compiling Libraries\com.unity.ads\Plugins\iOS\UnityBannerUnityWrapper.m...
+ [arm64] Compiling Libraries\com.unity.ads\Plugins\iOS\UnityAdsNativeObject.m...
+ [arm64] Compiling Libraries\com.hulugames.framework.sdk\Runtime\AppTracking\Plugins\iOS\PopupsManager.mm...
In file included from Libraries\com.hulugames.framework.facebooksdk\FacebookSDK\SDK\Editor\iOS\FBUnityInterface.mm:23:
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/FBUnitySDKDelegate.h(22,9): fatal error: 'UnityFramework/UnityFramework-Swift.h' file not found
#import <UnityFramework/UnityFramework-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ [arm64] Compiling Libraries\com.unity.mobile.notifications\Runtime\iOS\Plugins\UnityNotificationWrapper.m...
1 error generated.
+ [arm64] Compiling Libraries\com.unity.ads.ios-support\Runtime\Plugins\iOS\Categories\UASupportTools.m...
detected compiler error, aborting multithreaded build.
In file included from Libraries\com.hulugames.framework.facebooksdk\FacebookSDK\SDK\Editor\iOS\FBUnitySDKDelegate.m:20:
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/FBUnitySDKDelegate.h(22,9): fatal error: 'UnityFramework/UnityFramework-Swift.h' file not found
#import <UnityFramework/UnityFramework-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKGamingServicesKit'
import FBSDKGamingServicesKit
^
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKGamingServicesKit'
import FBSDKGamingServicesKit
^
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKGamingServicesKit'
import FBSDKGamingServicesKit
^
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKGamingServicesKit'
import FBSDKGamingServicesKit
^
Libraries/com.hulugames.framework.facebooksdk/FacebookSDK/SDK/Editor/iOS/Swift/FBSDKTournamentUpdater.swift:21:8: error: no such module 'FBSDKGamingServicesKit'
import FBSDKGamingServicesKit

append delete #6. Pierre-Marie Baty

Please send me your Xcode project to my email address pm<at>pmbaty<dot>com so that I reproduce the problem. I’ll study it and provide a fix. Confidentiality is guaranteed.

:: @Pierre-Marie Baty added on 27 May ’23 · 12:30

*edit* I found a testcase project on my drive with similar problem as yours. So, basically, at the moment, the toolchain is able to build targets such as iOS frameworks and libraries that are 100% written in Swift (i.e. all source files end in .swift), such as the Swift frameworks from the Google Firebase SDK 10.x, and bridge them to Objective-C code. It's not capable at the moment to build targets that have *mixed* Swift and Objective-C files, such as the Facebook SDK which your project uses. I thought they would work the same way, but Xcode handles these cases differently, and I have yet to implement that. Stay tuned. Now that I have a working Swift compiler, I don't expect that to be long.

append delete #7. cancan

Thank you Pierre, then I'm waiting for the update.

append delete #8. Pierre-Marie Baty

While I'm working on it, be aware that you *can* still build your project with the Facebook SDK right now, if you proceed manually. You need to not use CocoaPods, and link against the precompiled frameworks your project needs. You'll need to identify the framework(s) to which belong each unresolved symbol, then use the "Add extra framework" button and (possibly) add the -ObjC linker flag too. Follow the documentation for guidance on how to do that ; if you can't make it work in spite of the documentation, just ask here.

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