IPHONEOS_DEPLOYMENT_TARGET 设置为 8.0 Xcode 12 (Flutter)
IPHONEOS_DEPLOYMENT_TARGET is set to 8.0 Xcode 12 (Flutter)
我 运行 我在 Android Studio 中的 Flutter 项目,pod 安装很顺利,但是 Xcode 每次构建都在最后失败,比如首先完成整个构建的 20/30 步.
奇怪的是 Android Studio 说:
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleDataTransport' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'path_provider' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'nanopb' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'AppAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GTMAppAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'google_sign_in' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseCore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseFirestore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'firebase_core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'firebase_auth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'cloud_firestore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-Core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Firebase' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleSignIn' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'leveldb-library' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Flutter' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'abseil' from project 'Pods')
但是当我用 Xcode 打开工作区时,我看到我在 Runner 中的目标有 iOS deployment target 14.0
所以我不明白,它应该设置为 14 但实际上它是 8。
Flutter 通过 flutter run
生成 Podfile
、Podfile.lock
和 Pods
我更喜欢让 Flutter 处理 Pod 的生成和安装,而不使用 pod init
、pod install
或编辑Podfile
.
您需要在ios/Flutter/AppFrameworkInfo.plist
中将MinimumOSVersion
设置为9.0
。它看起来像这样:
<key>MinimumOSVersion</key>
<string>9.0</string>
除了 Akif 所说的之外,这里还有一个 运行 可能会出现此错误的原因列表:
- 在
ios/Flutter/AppFrameworkInfo.plist
中将MinimumOSversion
设置为9.0
- 在 Xcode 中,确保
Runner -> Project -> Runner
的 iOS 部署目标设置为 9.0
- 在Xcode中,确保
Runner -> Targets -> Runner
中的Deployment Info
设置为iOS 9.0
- 仔细检查您的
GoogleService-Info.plist
是否存在并且是通过 Xcode 添加的(例如不是通过 Finder copy/pasted 添加到目录中)
- 取消注释
ios/Podfile
中的 #platform :iOS, '9.0'
行
然后,运行在您的终端中以全新状态构建以下内容:
flutter clean \
&& rm ios/Podfile.lock pubspec.lock \
&& rm -rf ios/Pods ios/Runner.xcworkspace \
&& flutter build ios
替换pod文件的这段代码:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
enter image description here
- 打开xcode
- 更改项目文件 - 项目格式 - Xcode 8.0-兼容
- flutter clean,flutter pub 获得 flutter build ios
错误是不言自明的,即缺少应用程序的部署目标。
这将添加到 Xcode 内的两个位置,检查下面的屏幕截图,其中提到了 iOS 部署目标 。
1.亚军
2.Pod
如果在尝试了上述所有解决方案后,您的代码仍然无法正常工作,尤其是在 update/upgrade...
只需检查您的 dart 版本并检查空安全包...
我通过将我的代码正确迁移到 null safety,在与错误斗争了好几天后才解决了我的问题。
尝试 运行 in android 如果它给出任何可以修复的错误。
它记得我 删除我不使用的“dart.html”导入 然后这个错误也被修复了。但在我完成此页面中的每个解决方案之前,最好记住。
我 运行 我在 Android Studio 中的 Flutter 项目,pod 安装很顺利,但是 Xcode 每次构建都在最后失败,比如首先完成整个构建的 20/30 步. 奇怪的是 Android Studio 说:
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleDataTransport' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'path_provider' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'nanopb' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'AppAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleUtilities' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GTMAppAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'google_sign_in' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseCore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseFirestore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'FirebaseAuth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'firebase_core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'firebase_auth' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'cloud_firestore' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-Core' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Firebase' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'gRPC-C++-gRPCCertificates-Cpp' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'GoogleSignIn' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'leveldb-library' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'Flutter' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'abseil' from project 'Pods')
但是当我用 Xcode 打开工作区时,我看到我在 Runner 中的目标有 iOS deployment target 14.0
所以我不明白,它应该设置为 14 但实际上它是 8。
Flutter 通过 flutter run
生成 Podfile
、Podfile.lock
和 Pods
我更喜欢让 Flutter 处理 Pod 的生成和安装,而不使用 pod init
、pod install
或编辑Podfile
.
您需要在ios/Flutter/AppFrameworkInfo.plist
中将MinimumOSVersion
设置为9.0
。它看起来像这样:
<key>MinimumOSVersion</key>
<string>9.0</string>
除了 Akif 所说的之外,这里还有一个 运行 可能会出现此错误的原因列表:
- 在
ios/Flutter/AppFrameworkInfo.plist
中将 - 在 Xcode 中,确保
Runner -> Project -> Runner
的 iOS 部署目标设置为9.0
- 在Xcode中,确保
Runner -> Targets -> Runner
中的Deployment Info
设置为iOS9.0
- 仔细检查您的
GoogleService-Info.plist
是否存在并且是通过 Xcode 添加的(例如不是通过 Finder copy/pasted 添加到目录中) - 取消注释
ios/Podfile
中的
MinimumOSversion
设置为9.0
#platform :iOS, '9.0'
行
然后,运行在您的终端中以全新状态构建以下内容:
flutter clean \
&& rm ios/Podfile.lock pubspec.lock \
&& rm -rf ios/Pods ios/Runner.xcworkspace \
&& flutter build ios
替换pod文件的这段代码:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
enter image description here
- 打开xcode
- 更改项目文件 - 项目格式 - Xcode 8.0-兼容
- flutter clean,flutter pub 获得 flutter build ios
错误是不言自明的,即缺少应用程序的部署目标。
这将添加到 Xcode 内的两个位置,检查下面的屏幕截图,其中提到了 iOS 部署目标 。
1.亚军
2.Pod
如果在尝试了上述所有解决方案后,您的代码仍然无法正常工作,尤其是在 update/upgrade...
只需检查您的 dart 版本并检查空安全包...
我通过将我的代码正确迁移到 null safety,在与错误斗争了好几天后才解决了我的问题。
尝试 运行 in android 如果它给出任何可以修复的错误。 它记得我 删除我不使用的“dart.html”导入 然后这个错误也被修复了。但在我完成此页面中的每个解决方案之前,最好记住。