我试图运行Flutter应用程序,但得到这个错误
same issue here but none helped
Launching lib/main_dev.dart on iPhone 15 in debug mode...
main_dev.dart:1
Upgrading Pods-Runner-frameworks.sh
Xcode build done. 54.7s
Failed to build iOS app
Error (Xcode): Framework 'Pods_Runner' not found
Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
版本
[✓] Flutter (Channel stable, 3.10.5, on macOS 14.0 23A344 darwin-arm64, locale en-TR)
• Flutter version 3.10.5 on channel stable at /Users/yarenalbayrak/Developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (4 months ago), 2023-06-13 15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A240d
• CocoaPods version 1.11.3
x1c 0d1x每次运行都会创建pods_runner文件。
我的Podfile部分看起来像这样。当我删除use_frameworks!行不创建文件时,它运行我得到一些其他的问题。
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14'
end
end
end
3条答案
按热度按时间uqxowvwt1#
如果您在ios/Podfile中更改了平台,请不要忘记在Pods目标中更新iOS部署目标。
我引用了一个来自github链接的答案,这个链接在过去帮助了我-> https://github.com/flutter/flutter/issues/50711#issuecomment-770397291
vd8tlhqk2#
1.删除
Podfile
1.在Flutter程序中运行
flutter clean
,flutter pub get
,然后将生成Podfile
1.在新的
Podfile
中,将platform
调整为14.0并取消该行的注解1.在iOS程序中运行
pod install
一切都会好
6tqwzwtp3#
我通过this approach解决了这个问题,当我运行pod install时,它会给我警告
Runner [Debug-dev]
目标覆盖EXCLUDED_ARCHS[sdk=iphonesimulator*]
我进入Target -> Build Settings,搜索EXCLUDED_ARCHS,并将值更改为$(inherited)。