react-native-reanimated 的构建失败

Posted

技术标签:

【中文标题】react-native-reanimated 的构建失败【英文标题】:Build Failure for react-native-reanimated 【发布时间】:2021-11-27 17:24:54 【问题描述】:

这里是 React-native 新手。

我目前使用的是配备 OS 11.6 的 MacBook Air M1 2020,在安装 react-native-reanimated 后运行模拟器时遇到了问题。任何其他安装(例如@react-navigation/bottom-tabs 和@react-navigation/stack)都可以正常工作,但是当我在安装 react-native-reanimated 后尝试运行(react-native run-ios)时,它会给出以下错误消息:


** 构建失败 **

以下构建命令失败: CompileC /Users/USERNAME/Library/Developer/Xcode/DerivedData/App-bsbiygstdsripxdqednowpxwwzst/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/arm64/UIResponder +Reanimated.o /Users/USERNAME/Documents/GitHub/ReactNative-Projects/App/node_modules/react-native-reanimated/ios/native/UIResponder+Reanimated.mm normal arm64 objective-c++ com. apple.compilers.llvm.clang.1_0.compiler(在项目“Pods”的目标“RNReanimated”中)


当我第一次安装包时 "npm install react-native-reanimated", 它引发了一个漏洞问题,说有 65 个漏洞(10 个中等,30 个高,25 个严重) 但在“pod install”命令期间它不会导致任何问题。

向这个可怜的 react-native 新手发送帮助 :( 为这个问题苦苦挣扎了三天

【问题讨论】:

不久前我在升级到 React Native v0.65 和 React Navigation v5 时遇到了类似的问题。我不确定问题到底出在哪里,但我能够使用 latest 版本的 React Navigation (v6) 以及所有必需的共同依赖项,包括重新激活的库 (我需要它,因为我正在使用抽屉导航器)。我清除了我的node_modules 目录并删除了我的package-lock.json 文件并重新安装;现在看来一切正常。如果您还没有尝试过... 没有答案但遇到了同样的问题 - 如果您想跟踪它,它已记录在他们的问题页面上:github.com/software-mansion/react-native-reanimated/issues/2498 感谢@joshuaaron 的更新帖。我能够通过将 ios/Podfile 中的 use_flipper!( ) 更改为 use_flipper!( 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.87.0','Flipper -RSocket' => '1.3.1' )。但是现在该应用程序在尝试打开后立即关闭。永无止境的问题:( 感谢@ShawnFlahave 的回复。不幸的是对我不起作用:( 【参考方案1】:

react-native-reanimated 更新为2.3.0-beta.2 或更高版本。

【讨论】:

从 beta.1 升级到 beta.2 的区别是为我解决了这个问题,谢谢! 你是如何更新复活的?我尝试了“npm install react-native-reanimated@next”,但它已更新到 2.3.0-beta.1 并且给了我同样的错误。 已解决!使用清除缓存并使用“npm install react-native-reanimated@2.3.0-beta.2”。非常感谢!

以上是关于react-native-reanimated 的构建失败的主要内容,如果未能解决你的问题,请参考以下文章

React-native-reanimated:无法解析“./useValue”

在 react-native-reanimated 中继续循环动画

构建失败,因为 react-native-reanimated

构建失败'配置项目':react-native-reanimated'时出现问题。在 React 原生项目中

包 react-native-reanimated 找不到

MainApplication.java 上的 React-Native-Reanimated 错误