当前位置: 首页 > 知识库问答 >
问题:

此版本中使用了不推荐的Gradle功能,使其与Gradle 6不兼容

夹谷辰沛
2023-03-14

我试图让Apk反应原生,但是它没有给我任何东西。它说,Apk文件中的发布文件是空的,在Gradlew捆绑发布完成后

    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.4.1/userguide/command_line_interface.html#sec:command_line_warnings

我找不到解决这个问题的方法

    react-native run-android
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :app:transformClassesWithDexBuilderForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> java.nio.file.AccessDeniedException: /home/kourosh/Projects/FitnessApp/android/app/build/intermediates/transforms/dexBuilder/debug/45/androidx/versionedparcelable/R.dex

* 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.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 15s
19 actionable tasks: 1 executed, 18 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

java版本“12.0.1”2019-04-16节点-v10。16.0 npm-V6.9.0

共有3个答案

羊舌墨一
2023-03-14

在2020年,如果你有同样的问题,Powershell的这个建议对我很有帮助。

.\emulator.exe-avd"MyAvd"

在SDK emulator所在的目录(C:\Users\AppData\Local\Android\SDK\emulator)中运行上述命令,然后您可能会得到一些说明,如下所示:

您的模拟器已过时,请通过启动Android Studio更新:

  • 启动Android Studio
  • 选择“工具”菜单

这个链接也会有帮助。链接

华谭三
2023-03-14

这发生在我的一个项目中。这是在Windows中逐步修复它的步骤(10 64位):

1) 在没有Android Studio的情况下运行avd(https://windowsloop.com/launch-avd-manager-without-android-studio/)

2)在另一个控制台运行在您的项目gradle包装器(您必须安装Gradle 5.4.1(https://gradle.org/install/))

3) 然后移动到cd android,在这里运行gradlew clean

4) 移动到根目录cd 并运行react native start

5)在另一个控制台运行在您的项目反应本地运行Android

单于骁
2023-03-14

你试过运行吗/gradlew bundleRelease--所有警告模式

它将为您提供有关不兼容内容的更多信息。

 类似资料: