首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在此构建中使用了本机弃推荐的Gradle特性,使其与Gradle 8.0不兼容

在此构建中使用了本机弃推荐的Gradle特性,使其与Gradle 8.0不兼容
EN

Stack Overflow用户
提问于 2022-04-04 08:36:16
回答 2查看 8.5K关注 0票数 6

在安装了一些像react-native-safe-area-contextreact-native-screen这样的软件包之后,我总是有这样的问题:无法运行应用程序

当我运行纱线机器人:

代码语言:javascript
复制
> Configure project :react-native-async-storage_async-storage
Subproject ':react-native-async-storage_async-storage' has location 'D:\ewm\git\itc\node_modules\@react-native-async-storage\async-storage\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0.

> Configure project :react-native-safe-area-context
Subproject ':react-native-safe-area-context' has location 'D:\ewm\git\itc\node_modules\react-native-safe-area-context\android' which is outside of the project root. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0.

> Task :react-native-safe-area-context:compileDebugKotlin
w: D:\ewm\git\itc\node_modules\react-native-safe-area-context\android\src\main\java\com\th3rdwave\safeareacontext\SafeAreaView.kt: (50, 23): 'getter for uiImplementation: UIImplementation!' is deprecated. Deprecated in Java
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01

* What went wrong:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0

* 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 26s

当我运行react本机信息:

代码语言:javascript
复制
OS: Windows 10 10.0.19044
  CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Memory: 3.90 GB / 15.96 GB
Binaries:
  Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
  npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
  API Levels: 29, 30, 31, 32
  Build Tools: 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0
  System Images: android-Tiramisu | Google Play Intel x86 Atom_64
Android NDK: Not Found
Windows SDK:
  AllowAllTrustedApps: Disabled
  Versions: 10.0.18362.0, 10.0.19041.0
IDEs:
  Android Studio: Version     2021.1.0.0 AI-211.7628.21.2111.8193401
  Visual Studio: 16.11.32106.194 (Visual Studio Community 2019)
Languages:
  Java: 17.0.2
npmPackages:
  @react-native-community/cli: Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  *react-native*: Not Found
EN

回答 2

Stack Overflow用户

发布于 2022-05-11 21:45:10

在我的例子中,问题是与android资源文件夹中的重复文件有关。我使用下面的命令来删除副本。

代码语言:javascript
复制
rm -rf ./android/app/src/main/res/drawable-*

rm -rf ./android/app/src/main/res/raw

请参阅:https://stackoverflow.com/a/57975287/10030693

票数 0
EN

Stack Overflow用户

发布于 2022-08-20 23:13:46

使用./gradlew干净的删除所有以前的构建和重建

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71734196

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档