Home
2018年1月21日 星期日

[程式] Android Studio : Gradle error

Android Studio : Gradle error 透過Android Studio複習Android時,匯入Example時產生的錯誤訊息


Error:Minimum supported Gradle version is 4.1. Current version is 2.14.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\kingbow\AndroidStudioProjects\FragmentBasics\gradle\wrapper\gradle-wrapper.properties to gradle-4.1-all.zip


Consult IDE log for more details (Help | Show Log)




解決方式 :
1.
ProjectPath\FragmentBasics\gradle\wrapper\gradle-wrapper.properties

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


2.
ProjectPath\build.gradle

buildscript {
    repositories
{
       
...
       
// You need to add the following repository to download the
       
// new plugin.
        google
()
   
}

    dependencies
{
        classpath
'com.android.tools.build:gradle:3.0.1'
   
}
}


3.
Rebuild project,就可以順利執行

0 意見:

張貼留言