本文介绍了不兼容的Gradle功能不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行 react-native run-android
日志:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Android Gradle Plugin Version - 3.6.3
Gradle Version- 6.0.1
推荐答案
- 更新以下文件:
gradle-wrapper.properties
gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-6.0.1-all.zip
android/app/build.gradle
android/app/build.gradle
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true //add this
}
- 更新所有第三方依赖项
-
如果错误仍然存在,请运行以下命令:
- Update all your third-party dependencies
If the error still exists, run the below command:
cd android && ./gradlew clean && ./gradlew :app:bundleRelease
-
如果仍然存在,请尝试以下操作:
Try this if it still exists:
npm install --save-dev jetifier npx jetify npx react-native run-android
这篇关于不兼容的Gradle功能不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!