架构 x86_64 的未定义符号:“_OBJC_CLASS_$_RCTImageLoader”

Posted

技术标签:

【中文标题】架构 x86_64 的未定义符号:“_OBJC_CLASS_$_RCTImageLoader”【英文标题】:Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTImageLoader" 【发布时间】:2020-01-16 08:45:40 【问题描述】:

经过大量测试,我的应用无法在 iOS 上运行。

我有这个错误:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTImageLoader", referenced from:
     objc-class-ref in libRCTImageResizer.a(RCTImageResizer.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我用:

react: 16.12.0
react-native: 0.60.6

【问题讨论】:

【参考方案1】:

嘿,我从另一个来源得到了解决方法here 我不得不添加另一个名为“RNCMaskedView”的框架和“RNSScreen”

pre_install do |installer|
 installer.pod_targets.each do |pod|
   if pod.name.eql?('RNScreens') || pod.name.eql?('RNCMaskedView')
     def pod.build_type
       Pod::BuildType.static_library
     end
   end
  end
end

如果其他框架抛出错误,您可以尝试添加“RCTImageLoader”并跟进其他框架

只需在 pod 文件底部添加代码即可 保存 打开终端,进入项目中的 ios 文件夹并运行“pod install”

然后回到 Xcode ,清除你的构建 cmd + shift + k 给构建

应该可以正常使用

【讨论】:

【参考方案2】:

您似乎正试图在模拟器上运行应用程序,而 RCTImageResizer 的库不适用于模拟器。

能否请您尝试在设备上运行并检查。

【讨论】:

我尝试了,但没有任何改变:/ 可能,这个链接可以帮助你***.com/questions/18408531/… 终于可以了,我只是删除所有内容,重新安装,现在可以了!【参考方案3】:

删除“use_frameworks!”并在 pod 文件中使用“cocoapods-user-defined-build-types”插件,该插件允许 Podfile 指定应如何构建每个 Pod(或多个 Pod)(例如作为动态框架)。

plugin 'cocoapods-user-defined-build-types'

enable_user_defined_build_types!

target "CoffeeApp" do
    pod 'Alamofire'
    pod "SwiftyJSON", :build_type => :dynamic_framework

https://github.com/joncardasis/cocoapods-user-defined-build-types

它的工作..

【讨论】:

更详细地描述为什么需要每个步骤。

以上是关于架构 x86_64 的未定义符号:“_OBJC_CLASS_$_RCTImageLoader”的主要内容,如果未能解决你的问题,请参考以下文章

GoogleMapsSDK:架构 x86_64 的未定义符号

Cordova - 架构 x86_64 的未定义符号

架构 x86_64 的未定义符号:MqtUtil

切换到调试时架构 x86_64 的未定义符号

Xcode 错误 - 架构 x86_64 的未定义符号?

GraphicsMagick,架构 x86_64 的未定义符号