AndroidStudio Failed to Sync Gradle project, Faile

2019-03-06 08:15发布

How can I resolve the Gradle Sync problem? I installed the missing SDK versions but the error shown again.

Take a look to the screenshots please...

Screenshot 1 Screenshot 2

Thank you in advance.

2条回答
地球回转人心会变
2楼-- · 2019-03-06 09:01

You also need to open up "build.gradle" script and change the classpath to latest gradle repository.... mine is 'com.android.tools.build:gradle:3.0.0-alpha3'

Hope this helps everyone

查看更多
霸刀☆藐视天下
3楼-- · 2019-03-06 09:13

Your compileSdkVersion must be a number, not a String

Example:

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "com.yourpackage.yourapp"
        minSdkVersion 11
        targetSdkVersion 24
        versionCode 4
        versionName "1.3"
    }
    ...
}
查看更多
登录 后发表回答