[英]firebase messaging package error in IOS Podfile
应用程序工作正常,但是当我添加 firebase 消息包 10.0.0 时,我在控制台中收到错误并且应用程序无法打开。 已经尝试过之前文章中提到的许多与此类似的事情,但对我没有任何帮助。 已尝试删除/删除 pod 文件和文件夹,然后 repo update ,flutter clean 但仍然遇到此错误并且无法构建应用程序并在启动它时出错。 请帮忙..
Xcode's output:
↳
/Users/gagansingh/Desktop/projectApp/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/FIRMessagingPubSub.m:229:26: error: definition of 'GULSecureCoding' must be imported from module 'GoogleUtilities.GULSecureCoding' before it is required
NSData *pendingData = [GULSecureCoding archivedDataWithRootObject:topicsList error:&error];
^
In module 'GoogleUtilities' imported from /Users/gagansingh/Desktop/projectApp/ios/Pods/FirebaseMessaging/FirebaseMessaging/Sources/FIRMessagingPubSub.m:20:
/Users/gagansingh/Desktop/projectApp/ios/Pods/GoogleUtilities/GoogleUtilities/Environment/Public/GoogleUtilities/GULSecureCoding.h:22:12: note: definition here is not reachable
@interface GULSecureCoding : NSObject
播客文件:-
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
pod 'Google-Mobile-Ads-SDK'
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
如果有任何机构试图达到同样的效果。这些是我在 pod 文件中所做的更改。 首先删除 Podfile.lock 和 Pods 文件夹,并按照此处所做的那样在 pod 文件中进行更改,然后 flutter clean 然后再次运行。 您可能会再次遇到错误,因为它找不到 pods 文件夹和 pods file.lock 并且必须自己创建了新的。 检查这些是否已创建,然后再次运行。 在所有这些之前,您必须添加与您在 pubspec.ymal 中添加其他 firebase 软件包相同版本的 firebase_analytics,无论您是否使用它。
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
use_frameworks!
pod 'Google-Mobile-Ads-SDK'
pod 'Firebase/Core'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
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_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
target 'ImageNotification' do
pod 'Firebase/Messaging'
end
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
至
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.