2017-08-16 43 views
1

你好,我從Udacity下面的材料設計課程,當我下載他們在課程中提供的代碼,但是當我在Android中打開它時,它給了我那個錯誤找不到com.android.tools.build:gradle:2.2.3

Error:Could not find com.android.tools.build:gradle:2.2.3. 
Searched in the following locations: 
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom 
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar 
Required by: 
    :ApplyPaletteDemo:unspecified 
+0

嘗試[這](https://stackoverflow.com/questions/41570435/gradle-error-could-not-find-com-android-tools-buildgradle2-2-3/41570960),將解決。 – KeLiuyue

回答

0

檢查您的項目您的build.gradle文件的Android工作室的版本相匹配。該項目可能是爲舊版Android Studio編寫的。

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     maven{ 
      url "http://maven.google.com" 
     } 
    } 
} 
+0

我做到了,但這個錯誤發生**錯誤:(1,0)支持的最小Gradle版本是3.3。當前版本是2.14.1。如果使用gradle包裝,請嘗試編輯E:\ ApplyPaletteDemo \ gradle \ wrapper \ gradle-wrapper.properties中的distributionUrl到gradle-3.3-all.zip Open File ** –

+1

從https://gradle.org下載最新版本/發佈之後,轉到文件/項目結構/項目並將新版本放入gradle版本 –

+0

I下載了gradle version 4.1,並將提取的文件夾添加到.gradle文件中,並打開文件/項目結構/項目並編輯了gradle版本,但它給了我同樣的錯誤我不知道原因 –