欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android Studio3.0升級后使用注意事項及解決方法

 更新時間:2017年12月06日 11:04:27   作者:chasten08  
這篇文章主要介紹了Android Studio3.0升級后使用注意事項及解決方法,需要的朋友參考下吧

Gradle plugin最高版本4.*

老的項目在使用新版本時,可能會出現(xiàn)gradle plugin沖突的問題

Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) Re-download dependencies and sync project (requires network)

解決方法:

去往gradle安裝目錄(File->Other Settings->Default Settings,然后可以搜索gradle,右側(cè)有Service directory path可以看到你gradle目錄),.gradle\wrapper\dists目錄下找到和項目的gradle-wrapper.properties里版本號一致的文件(比如gradle-3.3-all)刪除,重新編譯即可

Cannot choose between the following configurations,產(chǎn)生這個問題的原因是項目用引用了其他項目,比如compileproject(:library),

解決方法:

Android Studio3.0以后需要使用如下方式:

implementation project(path: ':library', configuration: 'default')

伴隨著 Android Gradle 插件 2.2 版本的發(fā)布,近期 android-apt 作者在官網(wǎng)發(fā)表聲明證實了后續(xù)將不會繼續(xù)維護(hù) android-apt,并推薦大家使用 Android 官方插件提供的相同能力。也就是說,大約三年前推出的 android-apt 即將告別開發(fā)者,退出歷史舞臺,Android Gradle 插件提供了名為 annotationProcessor的功能來完全代替 android-apt,更換的步驟如下:

移除 Module 的 build.gradle 文件中對 android-apt 的相關(guān)配置,也就是刪除類似下面的配置:     

 buildscript {
      repositories {
        jcenter()
      }
      dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
      }
    }
    apply plugin: 'com.neenbedankt.android-apt'

將 Module 的 build.gradle 文件中使用 apt 引入的依賴修改為使用 annotationProcessor 進(jìn)行引入,修改前配置如下:

    dependencies {
     compile 'com.google.dagger:dagger:2.0'
     apt 'com.google.dagger:dagger-compiler:2.0'
    }

修改后配置如下: 

   dependencies {
      compile 'com.google.dagger:dagger:2.0'
      annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
    }

總結(jié)

以上所述是小編給大家介紹的Android Studio3.0升級后使用注意事項,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

  • 手機(jī)/移動前端開發(fā)需要注意的20個要點

    手機(jī)/移動前端開發(fā)需要注意的20個要點

    本文主要介紹了手機(jī)/移動前端開發(fā)需要注意的20個要點,具有很好的參考價值。下面跟著小編一起來看下吧
    2017-03-03
  • Android 阿里云OSS文件上傳的實現(xiàn)示例

    Android 阿里云OSS文件上傳的實現(xiàn)示例

    這篇文章主要介紹了Android 阿里云OSS文件上傳的實現(xiàn)示例,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • Android自定義半圓形圓盤滾動選擇器

    Android自定義半圓形圓盤滾動選擇器

    這篇文章主要為大家詳細(xì)介紹了Android自定義半圓形圓盤滾動選擇器 ,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • 最新評論