我不小心从我的应用程序中取消了 react-native-reanimated 的链接并开始出现此错误。另外值得一提的是我刚刚升级到 mac OS Ventura 13.2.1
npx react-native start
构建失败
我试过
cd android && ./gradlew clean
来解决这个问题,看起来它是在有一些错误的 reanimated 包
完整的错误日志:
> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.3.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 executed
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> Cannot invoke "String.startsWith(String)" because "versionOutput" is null
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> Cannot invoke "String.startsWith(String)" because "versionOutput" is null
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
我的 package.json 中有这个包:
"react-native-reanimated": "^3.0.2",
我在 babel.config.js 的插件中也有它
['react-native-reanimated/plugin', {
"relativeSourceLocation": true
}]
我在网上找不到任何类似的错误日志。
当我执行 npm install 时,它显示:
up to date, audited 1411 packages in 1s