架构为x86_64的未定义符号: "_OBJC_CLASS_$_RCTImageLoader"。

4

经过多次测试,我的应用无法在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
3个回答

3

嘿,我从另一个来源得到了一个解决方法这里。 我不得不添加另一个名为“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 进行构建。

应该可以正常工作。


0

移除 "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

它工作了...


更详细地描述每个步骤为什么是必要的。 - Fabian

0

看起来你正在尝试在模拟器上运行应用程序,但是 RCTImageResizer 库不可用于模拟器。

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


我尝试了,但是没有任何改变 :/ - Pentagura
也许这个链接可以帮助你 https://dev59.com/t2Ml5IYBdhLWcg3wbGh1 - Yasir Perwez
1
终于成功了,我刚刚把所有东西都删除了,重新安装,现在它可以工作了! - Pentagura

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接