- 首先檢視
安裝目錄下的android studio
檔案夾,如果你的gradle
檔案夾已經被删除,就到http://gradle.android-studio.org/重新下載下傳一個放到該目錄。gradle-2.10
- 然後進入
搜尋settings
,修改gradle
為下載下傳好的Gradle home
目錄。gradle-2.10
- 最後修改項目中
檔案的gradle/gradle-wrapper.properties
屬性(如distributionUrl
),以及distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
檔案中的build.gradle
版本,重新編譯,一切OKgradle
Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle. Learn about configuring HTTP proxies in Gradle
折騰半天終于解決問題,廢話不多說直接上圖1.打開項目目錄gradle/wrapper/:2.打開gradle-wrapper.properties檔案,把distributionUrl值替換掉,可以建立一個項目複制過來,回到項目重新sync一下即可
問題
在添加butterKnife依賴的時候出現如下錯誤:
Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- butterknife-7.0.1.jar
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
修改
1 2 3 4 5 6 7 8 9 10 11 | |
添加上面配置就好…………….