flutter No such module 'FBSDKCoreKit' error

Viewed 119

I am a beginner at app development. I am making an app with flutter, and the following error occurred while building with ios.

Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code

Swift Compiler Error (Xcode): No such module 'FBSDKCoreKit'
/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7
2

Could not build the application for the simulator.
Error launching application on iPhone 12.
Exited (sigterm)

But I never installed the facebook_auth package. There is no flutter_facebook_auth in my pubspec.yaml file either.

But I keep getting the above error. Is there any solution? Thank you for reading.

===============================================================

I did flutter clean -> flutter pub get -> cd ios -> pod install -> run

And following is the result

/Users/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_compress-1.1.0/ios/Classes/CompressFileHandler.m:109:16: warning: unused variable 'swf' [-Wunused-variable]
        const char swf[3] = {'F', 'W', 'S'};
                   ^
    /Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_image_compress-1.1.0/ios/Classes/CompressFileHandler.m:110:16: warning: unused variable 'swc' [-Wunused-variable]
        const char swc[3] = {'C', 'W', 'S'};
                   ^
    4 warnings generated.
    warning: [CP] Unable to find matching .xcframework slice in 'ios-arm64 ios-arm64_x86_64-simulator ios-arm64_x86_64-maccatalyst' for the current build architectures (arm64 x86_64 i386).
    Command CompileSwift failed with a nonzero exit code
    /Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
    import FBSDKCoreKit
           ^
    /Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
    import FBSDKCoreKit
           ^
    /Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:9:8: error: no such module 'FBSDKCoreKit'
    import FBSDKCoreKit
           ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    warning: Skipping duplicate build file in Copy Bundle Resources build phase: /Users//Downloads/GoogleService-Info.plist (in target 'Runner' from project 'Runner')
    Result bundle written to path:
        /var/folders/ly/7jxqf41945g08nj820kfkblr0000gn/T/flutter_tools.QgWT3r/flutter_ios_build_temp_diruHeVSi/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code

Swift Compiler Error (Xcode): No such module 'FBSDKCoreKit'
/Users//development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7
2

Could not build the application for the simulator.
Error launching application on iPhone 12.

Pod install result is fine. This is the part of the pod install result

================================================= pub.dartlang.org/flutter_facebook_auth-4.3.3/ios/Classes/FacebookAuth.swift:8:7 File contents:

facebookauth.swift file contents

===============================================

I found following-facebook auth related- messages when i run the app on real android device

error msg when running on android device

1 Answers

I resolve this error by doing

  1. remove Podfile.lock and Pods
  2. update Podfile with platform :ios, '12.0' and config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
  3. pod install

I also set the iOS deployment target to be 12.0 in the PROJECT.

Related