建筑的未定义符号ARM64:领域

发布于 2025-02-11 19:49:14 字数 4492 浏览 0 评论 0原文

尝试在RN版本上构建React Antive应用程序0.66.4和Realm V 2.29.0

Podfile

在尝试构建时具有Realm版本3.17.3,获取以下错误:

  "realm::BpTreeBase::replace_root(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >)", referenced from:
      realm::Column<long long>::replace_root_array(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >) in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_leaf(realm::MemRef) in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_empty_leaf() in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::clear() in libRealm.a(RLMCollection.o)
      realm::Column<long long>::replace_root_array(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >) in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_leaf(realm::MemRef) in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_empty_leaf() in libRealm.a(RLMOptionalBase.o)
      ...
  "realm::BpTreeBase::write_subtree(realm::BpTreeNode const&, unsigned long, unsigned long, unsigned long, realm::BpTreeBase::SliceHandler&, realm::_impl::OutputStream&)", referenced from:
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMAccessor.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(sync_permission.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(object_store.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(partial_sync.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(results.o)
      ...

还有很多其他类似的领域错误。

我尝试过

rm -rf ~/Library/Caches/CocoaPods
pod cache clean Realm
pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData

,但这对我没有帮助。

podfile

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'Ajjas' do
  config = use_native_modules!
  use_modular_headers!

  # Pods for Ajjas

  pod 'Realm', '3.17.3',:modular_headers => true
  pod 'Avro-C', '1.7.6'
  pod 'GoogleMaps', '3.7.0'
  pod 'SocketRocket', '0.5.1'
  pod 'IQKeyboardManager'
  pod 'FirebaseCrashlytics' # , '4.3.0'
  pod 'FirebaseAnalytics' #, '6.6.2'
  pod 'Fabric', '~> 1.10'

  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  # use_flipper!()
    # post_install do |installer|
    # end

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    # installer.pods_project.targets.each do |target|
    #   if target.name == 'React'
    #     target.remove_from_project
    #   end
    # end
  end
end

我不确定这是一个版本问题,因为它可以与较旧的react-native版本(0.60.5)一起使用(在<之间没有尝试代码> 0.60.5 和0.66.4版本,并直接跳到0.66.4),

使用XCode版本13.4.1 on MacBook M1。

关于如何解决此问题的任何帮助将不胜感激!

Trying to build react native app on ios(objective c) on RN version 0.66.4 and realm v 2.29.0.

The podfile has the Realm version 3.17.3

When trying to build, getting the following error:

  "realm::BpTreeBase::replace_root(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >)", referenced from:
      realm::Column<long long>::replace_root_array(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >) in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_leaf(realm::MemRef) in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_empty_leaf() in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::clear() in libRealm.a(RLMCollection.o)
      realm::Column<long long>::replace_root_array(std::__1::unique_ptr<realm::Array, std::__1::default_delete<realm::Array> >) in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_leaf(realm::MemRef) in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::EraseHandler::replace_root_by_empty_leaf() in libRealm.a(RLMOptionalBase.o)
      ...
  "realm::BpTreeBase::write_subtree(realm::BpTreeNode const&, unsigned long, unsigned long, unsigned long, realm::BpTreeBase::SliceHandler&, realm::_impl::OutputStream&)", referenced from:
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMCollection.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMOptionalBase.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(RLMAccessor.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(sync_permission.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(object_store.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(partial_sync.o)
      realm::BpTree<long long>::write(unsigned long, unsigned long, unsigned long, realm::_impl::OutputStream&) const in libRealm.a(results.o)
      ...

There are lot of other similar errors of realm.
Realm errors

I tried

rm -rf ~/Library/Caches/CocoaPods
pod cache clean Realm
pod deintegrate || rm -rf Pods
pod install --verbose
rm -rf ~/Library/Developer/Xcode/DerivedData

but this didn't help me.

podfile:

require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'

target 'Ajjas' do
  config = use_native_modules!
  use_modular_headers!

  # Pods for Ajjas

  pod 'Realm', '3.17.3',:modular_headers => true
  pod 'Avro-C', '1.7.6'
  pod 'GoogleMaps', '3.7.0'
  pod 'SocketRocket', '0.5.1'
  pod 'IQKeyboardManager'
  pod 'FirebaseCrashlytics' # , '4.3.0'
  pod 'FirebaseAnalytics' #, '6.6.2'
  pod 'Fabric', '~> 1.10'

  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  # use_flipper!()
    # post_install do |installer|
    # end

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    # installer.pods_project.targets.each do |target|
    #   if target.name == 'React'
    #     target.remove_from_project
    #   end
    # end
  end
end

I am not sure is this a version problem, because this was working with older react-native version(0.60.5) (didn't give a try between 0.60.5 and 0.66.4 versions and directly jumped to 0.66.4)

Using xcode version 13.4.1 on MacBook M1.

Any help on how to solve this problem will be much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无名指的心愿 2025-02-18 19:49:15

我有同样的问题。
我认为这与“ M1芯片”有关,图书馆尚未准备好。
https://github.com/realm/realm/realm/realm/realm-js/issues/3199

老实说,我仍然对这个问题的原因不信心。
但是无论如何,我通过这种流程解决了这个问题。

  1. 我遵循了此链接的流程如何在苹果硅(M1)上运行Cocoapods
# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods

# Reinstall cocoapods via Homebrew
brew install cocoapods

但您也可能会通过自制酿造的可可蛋白鱼类遇到问题。
然后按照此 https://docs.brew.sh/installation

  1. 打开“与Rosetta”打开“ with rosetta” “ Xcode”

此流程神奇地解决了我的问题。这可能无法解决您的问题,但我相信这些链接会给您提示解决您的问题。

祝你好运!

I had same problems.
I think it is related with "M1 chips", and libraries not ready for it..
https://github.com/realm/realm-js/issues/3199

Tobe honest, I'm still not confident about the reason for this problem.
But anyway, I solved this problem through this flow.

  1. I followed this flow from this link How to run CocoaPods on Apple Silicon (M1)
# Uninstall the local cocoapods gem
sudo gem uninstall cocoapods

# Reinstall cocoapods via Homebrew
brew install cocoapods

but you may have problem installing cocoapods through homebrew also.
then follow this https://docs.brew.sh/Installation

  1. Turn on "open with rosetta" on 'Xcode'

This flow magically solved my problem. It may not solve your problem, but I believe those links would give you hints to solve your problem.

Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文