Android studio 3.1后butterKnife配置

今天升級了下android studio到3.12.然后編譯之前的項目就出現(xiàn)兩個問題:

  • gradle4.4下載緩慢
  • Butterknife不兼容

第一個問題主要是gradle下載太慢,可以自己去gradle官網(wǎng)下載然后手動放到本地路徑。

image.png

出現(xiàn)問題的主要地方就是上面的地方,把這一行刪了,然后按下面步驟配置就行:

project.gradle:

buildscript {
    
    repositories {
        google()
        jcenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'


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

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.google.com' }
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

    }


}

task clean(type: Delete) {
    delete rootProject.buildDir
}

然后再配置app.gradle:

image.png

ok就行了,反正我的是可以跑起來了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 179,361評論 25 708
  • 字詞 1. If one good thing came out of the play. ex: 出現(xiàn),出版,結(jié)...
    仲孫書琴閱讀 163評論 0 0

友情鏈接更多精彩內(nèi)容