我想在Flutter应用程序中实现图像通知。我使用this doc设置了一切,当我在真实设备上运行时,图像通知起作用。
但是,当我尝试归档构建时,我遇到了这个错误。只有在删除MyImageNotification目标后,我才能成功归档。 这是当我完成Imagg通知设置后文件夹结构的样子
我从错误日志底部得到以下信息。
我的 Podfile 看起来像这样。
但是,当我尝试归档构建时,我遇到了这个错误。只有在删除MyImageNotification目标后,我才能成功归档。 这是当我完成Imagg通知设置后文件夹结构的样子
![enter image description here](https://istack.dev59.com/2X0UG.webp)
ld: warning: Could not find or use auto-linked framework 'Flutter'
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_FlutterError", referenced from:
objc-class-ref in firebase_core(FLTFirebasePlugin.o)
objc-class-ref in firebase_dynamic_links(FLTFirebaseDynamicLinksPlugin.o)
"_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
objc-class-ref in firebase_core(FLTFirebaseCorePlugin.o)
objc-class-ref in firebase_dynamic_links(FLTFirebaseDynamicLinksPlugin.o)
objc-class-ref in firebase_messaging(FLTFirebaseMessagingPlugin.o)
"_FlutterMethodNotImplemented", referenced from:
-[FLTFirebaseCorePlugin handleMethodCall:result:] in firebase_core(FLTFirebaseCorePlugin.o)
-[FLTFirebaseDynamicLinksPlugin handleMethodCall:result:] in firebase_dynamic_links(FLTFirebaseDynamicLinksPlugin.o)
-[FLTFirebaseMessagingPlugin handleMethodCall:result:] in firebase_messaging(FLTFirebaseMessagingPlugin.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我的 Podfile 看起来像这样。
# Uncomment this line to define a global platform for your project
# platform :ios, '9.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
target 'MyImageNotification' do
use_frameworks!
pod 'Firebase/Messaging'
end