How to fixe Xcode build error FBLPromises? ( Mac flutter)

1,812

in your project's pod file, add

use_modular_headers!

and comment out use frameworks

use_frameworks!
Share:
1,812
Nitneuq
Author by

Nitneuq

Updated on December 16, 2022

Comments

  • Nitneuq
    Nitneuq over 1 year

    How to resolve this error ?

    I have the last flutter upgrade, last Xcode 11.5, last MacOS catalina. I have done Xcode 11.5 migration (build phase), move to zsh, selected legacy build system, remove all package not compatible, relaunch pod install by focus the podfile folder with the terminal. Launch flutter clean. here is my doctor-v

        [✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale fr-FR)
        • Flutter version 1.17.5 at /Users/quentinguichot/Developer/flutter
        • Framework revision 8af6b2f038 (9 days ago), 2020-06-30 12:53:55 -0700
        • Engine revision ee76268252
        • Dart version 2.8.4
    
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/quentinguichot/Library/Android/sdk
        • Platform android-29, build-tools 29.0.2
        • Java binary at: /usr/bin/java
        ✗ Could not determine java version
    
     
    [✓] Xcode - develop for iOS and macOS (Xcode 11.5)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.5, Build version 11E608c
        • CocoaPods version 1.9.3
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
    
    [✓] Connected device (1 available)
        • iPhone • 00008030-000448183438802E • ios • iOS 13.3.1
    
    ! Doctor found issues in 2 categories.
    

    Here is my error :

    ld: framework not found FBLPromises
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        note: Using new build system
        note: Building targets in parallel
    
        note: Planning build
        note: Constructing build description
    

    I can run on my device a new projet, with the flutter example, but my projet ( currently in production) who worked fine before all these upgrade, have now this issue...

    edit : my podfile

    # Uncomment this line to define a global platform for your project
       platform :ios, '9.0'
    
    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    
    def parse_KV_file(file, separator='=')
      file_abs_path = File.expand_path(file)
      if !File.exists? file_abs_path
        return [];
      end
      generated_key_values = {}
      skip_line_start_symbols = ["#", "/"]
      File.foreach(file_abs_path) do |line|
        next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
        plugin = line.split(pattern=separator)
        if plugin.length == 2
          podname = plugin[0].strip()
          path = plugin[1].strip()
          podpath = File.expand_path("#{path}", file_abs_path)
          generated_key_values[podname] = podpath
        else
          puts "Invalid plugin specification: #{line}"
        end
      end
      generated_key_values
    end
    
    target 'Runner' do
      use_frameworks!
      use_modular_headers!
      
      # Flutter Pod
    
      copied_flutter_dir = File.join(__dir__, 'Flutter')
      copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
      copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
      unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
        # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
        # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
        # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
    
        generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
        unless File.exist?(generated_xcode_build_settings_path)
          raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
        end
        generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
        cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
    
        unless File.exist?(copied_framework_path)
          FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
        end
        unless File.exist?(copied_podspec_path)
          FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
        end
      end
    
      # Keep pod path relative so it can be checked into Podfile.lock.
      pod 'Flutter', :path => 'Flutter'
    
      # Plugin Pods
    
      # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
      # referring to absolute paths on developers' machines.
      system('rm -rf .symlinks')
      system('mkdir -p .symlinks/plugins')
      plugin_pods = parse_KV_file('../.flutter-plugins')
      plugin_pods.each do |name, path|
        symlink = File.join('.symlinks', 'plugins', name)
        File.symlink(path, symlink)
        pod name, :path => File.join(symlink, 'ios')
      end
    end
    
    # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
    #install! 'cocoapods', :disable_input_output_paths => true
    
    post_install do |installer|
       installer.pods_project.targets.each do |target|
         target.build_configurations.each do |config|
           config.build_settings['ARCHS'] = '$ARCHS_STANDARD_64_BIT'
         end
       end
     end
    

    FBLPromises seems to come from an old package I had add ( firebase_ad_mob) I don't know why it take reference while the package is remove ... I clean all, even derivedata and flutter repair cache

    Here is error after remove use_framwork!

          warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/FLTCookieManager.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/FLTWKNavigationDelegate.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/FLTWebViewFlutterPlugin.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/FlutterWebView.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/JavaScriptChannelHandler.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Headers/webview_flutter-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/webview_flutter/webview_flutter.framework/Info.plist' is located outside of the allowed root paths.
        ...
    
    
    ...
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/vibration/vibration.framework/vibration' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Headers/unique_identifier-Swift.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Headers/unique_identifier-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Info.plist' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/module.modulemap' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/Project/arm64.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/arm64-apple-ios.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/arm64-apple-ios.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/arm64.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/Modules/unique_identifier.swiftmodule/arm64.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/unique_identifier/unique_identifier.framework/unique_identifier' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/Headers' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/Headers/FLTSharedPreferencesPlugin.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/Headers/shared_preferences-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/Info.plist' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/Modules/module.modulemap' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/shared_preferences/shared_preferences.framework/shared_preferences' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/Headers' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/Headers/FLTSensorsPlugin.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/Headers/sensors-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/Info.plist' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/Modules/module.modulemap' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/sensors/sensors.framework/sensors' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Headers' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Headers/FlutterRoundedProgressBarPlugin.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Headers/flutter_rounded_progress_bar-Swift.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Headers/flutter_rounded_progress_bar-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Info.plist' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/Project/arm64.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/arm64-apple-ios.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/arm64-apple-ios.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/arm64.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/flutter_rounded_progress_bar.swiftmodule/arm64.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/Modules/module.modulemap' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_rounded_progress_bar/flutter_rounded_progress_bar.framework/flutter_rounded_progress_bar' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Headers' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Headers/FlutterEmailSenderPlugin.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Headers/flutter_email_sender-Swift.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Headers/flutter_email_sender-umbrella.h' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Info.plist' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/Project/arm64.swiftsourceinfo' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/arm64-apple-ios.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/arm64-apple-ios.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/arm64.swiftdoc' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/flutter_email_sender.swiftmodule/arm64.swiftmodule' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/Modules/module.modulemap' is located outside of the allowed root paths.
        
            warning: Stale file '/Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/flutter_email_sender/flutter_email_sender.framework/flutter_email_sender' is located outside of the allowed root paths.
        
            Command MergeSwiftModule failed with a nonzero exit code
            /Users/quentinguichot/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/vibration-1.2.2/ios/Classes/VibrationPlugin.m:4:17: error: definition of 'VibrationPlugin' must be imported from module 'vibration.VibrationPlugin' before it is required
            @implementation VibrationPlugin
                            ^
            In module 'vibration' imported from /Users/quentinguichot/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/vibration-1.2.2/ios/Classes/VibrationPlugin.m:2:
            /Users/quentinguichot/AndroidStudioProjects/ouiquit/build/ios/Debug-iphoneos/vibration/vibration.framework/Headers/VibrationPlugin.h:3:12: note: previous definition is here
            @interface VibrationPlugin : NSObject<FlutterPlugin>
                       ^
            1 error generated.
            note: Using new build system
            note: Building targets in parallel
            note: Planning build
            note: Constructing build description
    
  • Nitneuq
    Nitneuq almost 4 years
    I edit with my podfile. I have already this target 'Runner' do use_frameworks! use_modular_headers!
  • MobileMon
    MobileMon almost 4 years
    Try removing use_framewoks! but keeping use_modular_headers!