我已尝试一切方法来解决此错误,但没有任何效果,我将在下面留下我的 podfile、GeneratedPluginRegistrant 和 pubspec。如果您能帮忙我将非常感激
pubspec:
firebase_core: ^2.15.1
firebase_auth: ^4.1.0
flutter_launcher_icons: ^0.10.0
lottie: ^1.4.2
url_launcher: ^6.1.7
animated_bottom_navigation_bar: ^1.1.0
glassfy_flutter : ^1.3.1
cloud_firestore: ^4.4.5
flutter_native_splash: ^2.2.16
page_transition: ^2.0.9
audio_video_progress_bar: ^1.0.1
rxdart: ^0.27.7
rive: ^0.11.3
google_mobile_ads: ^3.0.0
firebase_messaging: ^14.6.7
overlay_support: ^2.1.0
onesignal_flutter: ^5.0.0
awesome_dialog: ^3.1.0
firebase_storage: ^11.6.0
image_picker: ^1.0.6
firebase_analytics: ^10.8.5
just_audio_background: ^0.0.1-beta.11
just_audio: ^0.9.36
audio_service: ^0.18.12
pod 文件:
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
target 'OneSignalNotificationServiceExtension' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'OneSignal'
# Pods for OneSignalNotificationServiceExtension
end
# 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__))
#target 'RunnerTests' do
# inherit! :search_paths
#end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
生成的插件注册者:
#import "GeneratedPluginRegistrant.h"
#if __has_include(<audio_service/AudioServicePlugin.h>)
#import <audio_service/AudioServicePlugin.h>
#else
@import audio_service;
#endif
#if __has_include(<audio_session/AudioSessionPlugin.h>)
#import <audio_session/AudioSessionPlugin.h>
#else
@import audio_session;
#endif
我已经尝试卸载并安装 Pod,并创建一个新的 iOS 文件夹,但没有成功。我也尝试在xcworkspace上运行它,但它不起作用
这个问题我已经深思了好几天了。
主要问题来自于
Minimum deployments
与项目中的所有文件不一致。
通常,我们只在 xcode 和 Pods 文件中签入
Minimum deployments
,但我刚刚找到了存储它的新位置。来自AppFrameworkInfo.plist
。只需用相同的Minimum deployments
更改即可。问题消失了。
因此,您需要做的就是为所有位置设置相同的最低版本。
project.pbxproj
文件更改方向):IPHONEOS_DEPLOYMENT_TARGET = 13.0; # or your minimum version
platform :ios, '13.0' # or your minimum version
...
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' # or your minimum version
...
end
end
end
AppFrameworkInfo.plist
文件中(路径 ios/Flutter/AppFrameworkInfo.plist
):<key>MinimumOSVersion</key>
<string>13.0</string> # or your minimum version
谢谢,希望这个解决方案能帮助您!