Search code examples
xcodeionic-frameworkcapacitor

Ionic capacitor randomly errored


Documents/Ionic Projects/Skwap/node_modules/@capacitor/cli/assets/capacitor-cordova-ios-plugins/sources/CordovaPluginFacebook4/src/ios/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKConstants.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This error has started popping up when i try and build my app and run with xcode. Everything works in the browser so it must be an error with capacitor.

I have done as it says and disabled bitcode in both app and pods settings. Along with this is 'Command CompileSwift failed with a nonzero exit code'.

i have updated all npm packages and still no change.


Solution

  • The latest version of cordova-plugin-facebook4 updated the Facebook framework files and looks like they don't have bitcode enabled, so you'll have to disable it in your targets to make the build work. (or downgrade to previous version of the plugin and run npx cap update)

    To disable bitcode in all your targets you can add this to the ProjectName/ios/App/Podfile and then run npx cap update

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['ENABLE_BITCODE'] = 'NO'
            end
        end
    end