首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未加载的库:@rpath/hermes.framework/hermes

未加载的库:@rpath/hermes.framework/hermes
EN

Stack Overflow用户
提问于 2022-01-27 08:12:39
回答 5查看 2.6K关注 0票数 8

我已经在我的react本机(v0.64)应用程序中启用了Hermes。每次我运行应用程序时,我都会跟踪堆栈跟踪。

代码语言:javascript
运行
复制
dyld: dyld cache load error: shared cache file open() failed
dyld: Library not loaded: @rpath/hermes.framework/hermes
  Referenced from: /Users/sharktank/Library/Developer/CoreSimulator/Devices/A32F4931-51A8-4D22-AEFB-625F834CE221/data/Containers/Bundle/Application/71773888-08D5-4B82-9545-07F6B1538864/COSPM-DEV.app/COSPM-DEV
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/sharktank/Library/Developer/CoreSimulator/Caches/dyld/20E232/com.apple.CoreSimulator.SimRuntime.iOS-14-4.18D46
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/sharktank/Library/Developer/Xcode/DerivedData/COSPM-atbujvbobdbyehckyoqrdgmqiubm/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSim
(lldb) 

我在Podfile中启用了hermes,并且在Pods文件夹中安装了pod。项目位于另一个项目旁边的单一体系结构中。另一个在同一个单回购包中使用Hermes的应用程序运行良好,没有崩溃。

Podfile:

代码语言:javascript
运行
复制
require_relative '../../../node_modules/react-native/scripts/react_native_pods'
require_relative '../../../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'
source 'https://github.com/CocoaPods/Specs.git'

target 'COSPM' do
  config = use_native_modules!

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

  pod 'RNVectorIcons', :path => '../../../node_modules/react-native-vector-icons'

 # Firebase
  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'CodePush', :path => '../../../node_modules/react-native-code-push'


  target 'COSPMTests' do
    inherit! :complete
    # Pods for testing
  end

  # 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|
    react_native_post_install(installer)
  end
end

我正在使用Xcode 12.4。

我尝试了一些无效的解决方案:

  1. 清洁Pods和npm包,清洁以前的构建和重建
  2. 清除看守人和城域绑定器缓存和重建
EN

Stack Overflow用户

发布于 2022-11-17 19:59:42

其他答案建议禁用Hermes或手动将其添加为链接库,但这不应该是必要的。

最新版本应该自动安装Hermes框架.

这个问题似乎与使用不正确的CocoaPods版本和pods回购有关。

要更新所有内容,请执行以下操作:

  1. 将Ruby升级到最新版本。(使用说明)
  2. 将CocoaPods升级到最新版本:gem install cocoapods
  3. 更新CocoaPods回购:pod repo update
  4. 删除Podfile.lock
  5. 重新安装豆荚cd ./ios && pod install

如果仍然有错误,请再次检查是否实际使用了正确的版本(在PATH中)。

我还写了一篇关于这个错误的博客文章,如果您想了解更多细节:https://traviswimer.com/blog/cocoapods-could-not-find-compatible-versions-for-pod-hermes-engine/

票数 1
EN
查看全部 5 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70875239

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档