8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

架构 arm64 的未定义符号:'_OBJC_CLASS_$_FlutterError'

E.Bibler 1月前

14 0

我想在 Flutter 应用中实现图像通知。我使用此文档设置了所有内容,当我运行真实设备时,图像通知有效。但是,当我尝试存档构建时,我

我想在 Flutter 应用中实现图像通知。我使用 此文档 ,当我运行真实设备时,图像通知有效。

但是,当我尝试存档构建时,我收到此错误。只有删除 MyImageNotification 目标后,我才能进行存档。

enter image description here

这是我完成 imagg 通知设置后的文件夹结构

我从错误日志的底部收到以下消息

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


帖子版权声明 1、本帖标题:架构 arm64 的未定义符号:'_OBJC_CLASS_$_FlutterError'
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由E.Bibler在本站《xcode》版块原创发布, 转载请注明出处!
最新回复 (0)
  • 可能的解决方案 #1

    在 ios 文件夹内尝试:

    1. rm -rf Pods/Podfile.lock.symlinks Flutter/Flutter.podspec Runner.xcworkspace
    2. pod repo 更新
    3. pod 安装
    4. 运行档案

    可能的解决方案 #2

    如果上述步骤不起作用,请确保将目标风格的“仅构建活动架构”设置为“否”

    enter image description here

    可能的解决方案 #3

    这个想法是提高目标 ios 版本。在您的 podfile 中设置:

    platform :ios, '10.0'
    

    并按以下方式修改安装后脚本:

    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['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
        end
      end
    end
    

    然后重新安装 pods( pod deintegrate , pod install )

  • Iain 1月前 0 只看Ta
    引用 3

    另外,第三种方法不起作用。当我删除 MyImageNotification 文件时,构建可以存档。使用图像通知,我无法将其存档

返回
作者最近主题: