任务:react-native-screens:compileDebugJavaWithJavac失败

Aru*_*n.k 5 react-native react-navigation-v5

我使用反应导航v5..安装了所有依赖项..现在我收到以上错误..失败:构建失败并出现异常。

* What went wrong:
Execution failed for task ':react-native-screens:compileDebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
Run Code Online (Sandbox Code Playgroud)

use*_*148 5

在终端中运行此命令

  1. 安卓系统

// 检查是否有守护进程在运行。

  1. ./gradlew --status 或 .\gradlew --status
  2. ./gradlew --停止
  3. ./gradlew 干净
  4. 光盘 ..

//然后重启服务器


Aki*_*nda 1

我认为这个问题仍然在 GitHub issues -> View上打开

如果你的 React Native 版本 < 0.60 那么你可以使用 Jetifier 来解决这个问题

如何使用Jetifier来解决?

  1. yarn add --dev jetify
  2. 然后在 package.json 脚本中添加:
    • "postinstall": "jetify"
  3. 纱线喷射

如果你的 React Native 版本是 0.60 > 那么试试这个

cd android && ./gradlew clean
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

13471 次

最近记录:

3 年,2 月 前