ios - Flutter 在不支持的 iOS 版本上运行
问题描述
我刚刚生成了一个新的 podfile 并安装了一个带有 iOS 10 的模拟器。podfile 的 ios 平台版本设置为 11.0,但是当我在 ios 10 模拟器上运行时,它会安装并打开(尽管崩溃)。为什么没有构建/安装错误,因为模拟器版本低于 podfile 平台版本。
# Uncomment this line to define a global platform for your project
platform :ios, '11.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 flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
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)
end
end
我是不是做错了什么,这让我发疯。
- 编辑
产生以下差异
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
- <string>8.0</string>
+ <string>11.0</string>
</dict>
</plist>
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 50;
+ objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
@@ -370,6 +370,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -507,6 +508,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -538,6 +540,7 @@
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
但是在ios 10模拟器上安装还是很开心的
解决方案
推荐阅读
- mathematical-optimization - 如何制定线性规划的初始投资?
- identityserver4 - IdentityServer4 请求太长
- node.js - 节点持久化:initSync 不是函数
- java - eclipse google cloud from appengine sdk迁移问题
- specman - Specman e:有没有办法知道枚举类型中有多少个值?
- java - JavaFX 媒体播放器不播放视频
- beautifulsoup - BeautifulSoup 从锚标记内的脚本中获取文本
- cocoa - 在可可应用程序的不同视图控制器上启用或禁用菜单项?
- java - com.example.daoImpl.FileDaoImpl 中的字段 entityManagerFactory 需要找不到类型为“javax.persistence.EntityManagerFactory”的 bean
- ios - 需要检查我的数组中的特定键值