IOS Podfile中的firebase消息包错误



应用程序工作正常,但当我添加firebase消息包10.0.0时,我在控制台得到错误,应用程序不打开。我已经尝试了很多类似的事情,但没有什么对我有效。已经尝试删除/删除pod文件和文件夹,然后回购更新,颤振干净,但仍然坚持这个错误,不能建立应用程序和错误在启动它。请帮助. .

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 

Podfile: -

# 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。锁定和Pods文件夹,并在pod文件中进行更改,然后进行清理,然后再次运行。您可能会再次遇到错误,因为它找不到pods文件夹和pods文件。锁住了,肯定是自己创造了新的。检查这些文件是否已创建,然后再次运行。在此之前,您必须添加与在pubspec中添加其他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