gpt4 book ai didi

xcode - 如何修复 Xcode 构建错误 FBLPromises? (Mac flutter )

转载 作者:行者123 更新时间:2023-12-04 13:34:58 25 4
gpt4 key购买 nike

如何解决此错误?
我有最后一次 flutter 升级,最后一次 Xcode 11.5,最后一次 MacOS catalina。我已经完成了 Xcode 11.5 迁移(构建阶段),移动到 zsh,选择了旧构建系统,删除了所有不兼容的包,通过在终端上聚焦 podfile 文件夹重新启动 pod install。启动 flutter 干净。
这是我的医生-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.
这是我的错误:
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
我可以在我的设备上运行一个新的项目,以 flutter 为例,但是我的项目(目前正在生产)在所有这些升级之前运行良好,现在有这个问题......
编辑:我的 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 似乎来自我添加的旧包 (firebase_ad_mob) 我不知道为什么它在包被删除时引用......我清理了所有,甚至是衍生数据和 flutter 修复缓存
这是删除 use_framework 后的错误!
      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

最佳答案

在项目的 pod 文件中,添加

use_modular_headers!
并注释掉使用框架
use_frameworks!

关于xcode - 如何修复 Xcode 构建错误 FBLPromises? (Mac flutter ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62742292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com