Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build module 'FBSDKLoginKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)', while this compiler is 'Apple Swift version 5.8 (swiftlang-5.8.0.119.11 clang-1403.0.22.11.100)'). Please select a toolchain which matches the SDK. #2186

Open
4 of 5 tasks
NigamAnkit opened this issue Mar 4, 2023 · 17 comments

Comments

@NigamAnkit
Copy link

NigamAnkit commented Mar 4, 2023

Checklist before submitting a bug report

Xcode version

14.3 beta 2

Facebook iOS SDK version

14.1.0

Dependency Manager

CocoaPods

SDK Framework

Login

Goals

Want to compile and run the project

Expected results

Should be able to create a build

Actual results

Build failed

Steps to reproduce

Building for actual device or simulator produces the same result. But worked fine with Xcode 14.2.
Apple M1 chip machine is used.

@ZOlbrys
Copy link

ZOlbrys commented Mar 7, 2023

Likely related to Xcode not being used in rosetta mode anymore (14.3 drops this).

I'm using FB SDK v 14.1 via SPM and same issue occurs.

Updating to v 16.0.0 may have avoided this, but I am seeing other build errors so I cannot confirm (not sure if it's related to FB SDK still or not) - other tests/input would be good to confirm whether 16.0.0 (or any other updated version) fixes this issue.

edit: I encountered a new FB sdk error (same one as before, just later in the process), so I don't think 16.0.0 will be the fix here.

@SunZhiC
Copy link

SunZhiC commented Mar 8, 2023

try to build source code and export XCFramework with your Xcode version, it is a work around.
or use Xcode14.1 or Xcode14.2 with FB v16.0.0.

@aim2120
Copy link

aim2120 commented Mar 8, 2023

I'm encountering the same issue using SPM. I tried updating to 16.0.0 but no dice. I'm hoping to avoid a manual workaround like building an XCFramework from source, so hope this is resolved soon!

@tugsadsen
Copy link

same issue with Xcode 14.1

@markuspersson
Copy link

markuspersson commented Mar 21, 2023

Same in Xcode 14.3 RC. Hope to get this fixed soon enough

@make1a
Copy link

make1a commented Mar 23, 2023

Same issue in Xcode 14.3 RC:

Failed to build module 'FBSDKCoreKit'; 
this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)', while this compiler is 'Apple Swift version 5.8 (swiftlang-5.8.0.124.1 clang-1403.0.22.11.100)').
 Please select a toolchain which matches the SDK.

@lukas-ruzicka
Copy link

lukas-ruzicka commented Mar 23, 2023

+1

(Xcode 14.3 RC)

@edolorenza
Copy link

xcode cloud failed to build

Failed to build module 'FBSDKCoreKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)', while this compiler is 'Apple Swift version 5.8 (swiftlang-5.8.0.124.1 clang-1403.0.22.11.100)'). Please select a toolchain which matches the SDK.

@username0x0a
Copy link

Duplicate of #2180.

@coucoseth
Copy link

any fix to this issue?

@YTCCC
Copy link

YTCCC commented Dec 14, 2023

Showing Recent Messages
/Users/doublefs/Library/Developer/Xcode/DerivedData/Runner-bblyvpzaaclkmafagznqkesebbzq/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FBAEMKit/FBAEMKit.framework/Modules/FBAEMKit.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface:1:1: Failed to build module 'FBAEMKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)', while this compiler is 'Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)'). Please select a toolchain which matches the SDK.

这个问题有什么解决方案么?

@Mallick-Shrutik
Copy link

Mallick-Shrutik commented Dec 29, 2023

Failed to build module 'FBSDKCoreKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)', while this compiler is 'Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)'). Please select a toolchain which matches the SDK.

Xcode version 14.0
FBSDKCoreKit version 16.3.1

tried to downgrade the SDK version to 16.0, 15.1 for trial and error but couldn't resolve.

Will do more trial and errors meanwhile in all ways possible.

@OlegNovosad
Copy link

OlegNovosad commented Apr 1, 2024

Same issue here, XCode 15.3 . Any workarounds? Cannot submit to review because I cannot build an archive for submission =/

Swift Compiler Error (Xcode): No such module 'FBSDKCoreKit'
/Users/onov/VSCodeProjects/tekstom/build/ios/Debug-dev-iphonesimulator/XCFrameworkIntermediates/FBSDKLoginKit/FBSDKLoginKit.framework/Modules/FBSDKLoginKit.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface:5:7
arm64-apple-ios-simulator.private.swiftinterface:5

Swift Compiler Error (Xcode): Failed to build module 'FBSDKLoginKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)', while this compiler is 'Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)'). Please select a toolchain which matches the SDK.
/Users/onov/.pub-cache/hosted/pub.dev/flutter_facebook_auth-6.1.1/ios/Classes/FacebookAuth.swift:8:7

@katleta3000
Copy link

The same issue with Xcode 15.3
I did some research, so here are the reasons and a way to fix the problem yourself until the FB team considers it severe.

The problems roots

  1. SPM downloads the source code of FB libraries and pre-compiled xcframeworks (check the Package.json). When you compile your project, the pre-compiled xcframeworks are used, not the source code.
  2. If you use the latest Xcode 15.3, which runs Swift 5.10 (5.10.0.13) toolchain, you receive an error like

Failed to build module 'FBSDKCoreKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)', while this compiler is 'Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)'). Please select a toolchain that matches the SDK.

Because the current version of the FB dependency, 17.0.0, was compiled with Swift 5.9.2 (5.9.2.2.56), and module stability with swift evolution available from Swift 5.1 is not yet enabled (BUILD_LIBRARY_FOR_DISTRIBUTION is not set)

  1. If you downgrade to XCode 15.1 / 15.2, you may see an error like

PagingCollectionViewLayout.swift Compiling for iOS 12.0, but module 'Network' has a minimum deployment target of iOS 14.0

This happens if the deployment target in your project settings is higher than iOS 14. The pre-compiled xcframeworks were compiled with the iOS 12 deployment target.

How to fix by yourself

Download the source code and re-compile it. It's easy, but here are some tips not to waste your time:

  1. Change the EXPECTED_XCODEGEN_VERSION in generate-projects.sh to your version of xcodegen. In my case, it was 2.40.0. The required 2.29.0 is not available through Brew.
  2. There are many xcconfigs, including IPHONEOS_DEPLOYMENT_TARGET; change all of them. By the way some of them are not used due to xcodeproj overriding settings. The magic is not to forget to change IPHONEOS_DEPLOYMENT_TARGET in Configurations/Platform/iOS.xcconfig. It is used when compiling, but the file itself is not included in FacebookSDK.xcworkspace
  3. Use BuiltAllKits-Dynamic or BuiltAllKits-Static (you may check a brilliant explanation of the differences here. Unfortunately, I failed in using static linking. But I will put this aside. The dynamic linking still works for me.
  4. You should compile all the frameworks you need both for arm64 and x86_64 and then make an xcframework with a code like

xcrun xcodebuild -create-xcframework -framework device/FBSDKCoreKit.framework -framework simulator/FBSDKCoreKit.framework -output FBSDKCoreKit.xcframework

  1. Finally, drag-n-drop the result FBSDKCoreKit.xcframework and others to your project.

That's it. Long story short:

  1. Install xcodegen
  2. Change EXPECTED_XCODEGEN_VERSION in generate-projects.sh
  3. Run generate-projects.sh
  4. Change all the IPHONEOS_DEPLOYMENT_TARGET, don't forget about Configurations/Platform/iOS.xcconfig
  5. Compile both for arm64 and x86_64
  6. Build an xcframework
  7. Link it to your project

What should be fixed by the FB team

  1. Please add module stability and swift evolution
  2. Please let us compile the source code when using SPM depending on the deployment target of the project (not restricted to iOS 12)

@th-mustache-dk
Copy link

th-mustache-dk commented Apr 26, 2024

👍

@angelmic
Copy link

same issue

@QaziAmmar
Copy link

same issue in Xcode 15.3
Failed to build module 'FBSDKGamingServicesKit'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)', while this compiler is 'Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)'). Please select a toolchain which matches the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests