iphone - 适用于 iOS 的 Flutter 构建档案无法稳定
问题描述
我正在为我的应用程序使用 Flutter stable 1.22.5,它在 iPhone 14.2 上运行完美。但我无法存档我的构建以在 TestFlight 上发布它。我收到 errorParse 问题组 ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'apple_sign_in' not found。大师版和测试版中的相同错误。我已经尝试删除 iOS 文件夹并重新创建它,但这不起作用。还使用了以下终端命令:
- 扑干净
- rm -Rf iOS/Pods
- rm -Rf ios/.symlinks
- rm -Rf ios/Flutter/Flutter.framework
- rm -Rf ios/Flutter/Flutter.podspec
- pod 缓存清理——全部
- Flutter 获取包
- 吊舱安装和更新。
我的问题仅出现在 iPhone 上发布的存档构建中。我该如何解决?
播客文件
取消注释此行以为您的项目定义一个全球平台
平台:ios,'9.3'
# 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
def flutter_install_ios_plugin_pods(ios_application_path = nil)
# defined_in_file is set by CocoaPods and is a Pathname to the Podfile.
ios_application_path ||= File.dirname(defined_in_file.realpath) if self.respond_to?(:defined_in_file)
raise 'Could not find iOS application path' unless ios_application_path
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
symlink_dir = File.expand_path('.symlinks', ios_application_path)
system('rm', '-rf', symlink_dir) # Avoid the complication of dependencies like FileUtils.
symlink_plugins_dir = File.expand_path('plugins', symlink_dir)
system('mkdir', '-p', symlink_plugins_dir)
plugins_file = File.join(ios_application_path, '..', '.flutter-plugins-dependencies')
plugin_pods = flutter_parse_plugins_file(plugins_file)
plugin_pods.each do |plugin_hash|
plugin_name = plugin_hash['name']
plugin_path = plugin_hash['path']
if (plugin_name && plugin_path)
symlink = File.join(symlink_plugins_dir, plugin_name)
File.symlink(plugin_path, symlink)
if plugin_name == 'flutter_ffmpeg'
pod 'flutter_ffmpeg/https-gpl', :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
else
pod plugin_name, :path => File.join('.symlinks', 'plugins', plugin_name, 'ios')
end
end
end
end
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['ENABLE_BITCODE'] = 'NO'
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
解决方案
推荐阅读
- javascript - 如何在本机反应中从单个元素创建数组?
- python - Python Beautiful Soup 错误提取 src
- node.js - 如何使用 NodeJS 发送文件?(打开发送的文件时出现错误)
- python - 从保留形状的现有数据集创建新的 HDF5 数据集
- spring - Spring Security Ldap Authentication Filter 中的大括号如何工作?
- firebase - 我怎样才能捕捉到让我的页面变慢的脚本?
- python - 如何从应该是字典的长字符串中创建数据框?
- python - Django 泊坞窗 Postgresql
- python - 使用 Apache 2 使用路由和静态文件调整转发到 Flask 应用程序
- date - Chart.js 使用 x 轴中反映实时间隔(不均匀分布)的日期创建折线图