我刚刚使用
expo
将 51.0.28
更新为版本 react native
,并将 0.74.5
更新为版本 npx expo-doctor
。
但现在我在启动项目时遇到这个错误,在 Hermes 引擎 github 问题中找不到任何线索。
Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined method `visionos' for #<Pod::Specification name="hermes-engine/Pre-built">.
# from /Users/my-project/node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec:47
# -------------------------------------------
# ss.ios.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
> ss.visionos.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
# ss.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
# -------------------------------------------
有人也遇到这样的情况吗?
我尝试过,删除node_module、ios目录并重新安装,但没有帮助。
然后我将反应本机升级到“0.75.0”,因为它是最新的,没有帮助。
目前的解决方案
开
node_modules/react-native/sdks/hermers-engine/hermes-engine.podspec
我评论掉了
# ss.visionos.vendored_frameworks = "destroot/Library/Frameworks/universal/hermes.xcframework"
并用
npx patch-package react-native
修补它
我会密切关注问题,尽快删除补丁。