简体   繁体   English

Android studio 显示错误,gradle 文件,请找到解决方案,它显示了一些错误

[英]Android studio showing error,gradle file,please find the solution,it shwing some find of error

When I sync my project in Android Studio, I got this error当我在 Android Studio 中同步我的项目时,出现此错误

ERROR: Cause: https://downloads.gradle-dn.com/distributions/gradle-3.4.2-all.zip错误:原因: https : //downloads.gradle-dn.com/distributions/gradle-3.4.2-all.zip

I think you have added wrong dependency package.我认为您添加了错误的依赖包。

So Go to gradle > wrapper > gradle-wrapper.properties and checkout your "distributionUrl" has the correct value or not.因此,转到 gradle > wrapper > gradle-wrapper.properties 并检查您的“distributionUrl”是否具有正确的值。

You have added a wrong package gradle-3.4.2-all.zip.您添加了错误的包 gradle-3.4.2-all.zip。 try changing it to gradle-4.10.2-all.zip尝试将其更改为 gradle-4.10.2-all.zip

I hope this helps.我希望这有帮助。

Don't confuse gradle with the Android Gradle plugin .不要将gradleAndroid Gradle 插件混淆。

classpath 'com.android.tools.build:gradle:3.4.2'

It is the Android Gradle plugin .它是Android Gradle 插件
Check the release notes for other versions. 查看其他版本的发行说明

The gradle version is defined in gradle/wrapper/gradle-wrapper.properties . gradle 版本gradle/wrapper/gradle-wrapper.properties定义。
Use:用:

distributionUrl = https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM