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

詳解android項(xiàng)目由Gradle 2.2 切換到 3.0的坑

 更新時(shí)間:2018年02月02日 11:44:51   作者:春暖花開_love  
本篇文章主要介紹了詳解android項(xiàng)目由Gradle 2.2 切換到 3.0的坑,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

問(wèn)題1、運(yùn)行的時(shí)候一直報(bào)如下錯(cuò)誤

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForApiTestDebug'. 
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex 

查了很多資料,大概意識(shí)是引用重復(fù)的庫(kù)或jar的問(wèn)題。

然后一遍一遍的檢查,發(fā)現(xiàn)并沒有引用重復(fù)的jar包。

最后考慮是不是第三方庫(kù)引用jar出現(xiàn)的問(wèn)題,然后就一個(gè)一個(gè)排查第三方庫(kù),最后發(fā)現(xiàn)我們用支付用的是

compile 'com.pingxx:pingpp-alipay:2.1.9' // 使用支付寶時(shí)添加

發(fā)現(xiàn)這個(gè)庫(kù)有些問(wèn)題,竟然在里面引用兩個(gè)版本的支付寶的jar包,果斷的換了最新版本,檢查了一個(gè)這次就引用了一個(gè)jar包。重新編譯了一下項(xiàng)目,運(yùn)行成功,問(wèn)題解決了。

特別注意:引用第三方庫(kù)在gralde3.0版本是更為嚴(yán)格,要特別注意。

問(wèn)題2、

AAPT2

AAPT2 將默認(rèn)啟用,如果遇到離奇的問(wèn)題,可以嘗試禁用,只要在 gradle.properties 中加入:

android.enableAapt2=false

其他:

應(yīng)用(app)目錄下build.gradle(下面 implementation "com.android.support:design:25.4.0" 切換為 project的統(tǒng)一配置)

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 
apply plugin: 'com.google.gms.google-services' 
   android { 
    compileSdkVersion 25 
    buildToolsVersion "26.0.2" 
 
    defaultConfig { 
      multiDexEnabled true 
      applicationId "com.example" 
      minSdkVersion 21 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
 
      renderscriptTargetApi 23 
      renderscriptSupportModeEnabled true 
 
    } 
    compileOptions { 
      sourceCompatibility JavaVersion.VERSION_1_8 
      targetCompatibility JavaVersion.VERSION_1_8 
    } 
    lintOptions { 
      quiet true 
      abortOnError false 
      ignoreWarnings true 
      disable 'InvalidPackage'      //Some libraries have issues with this. 
      disable 'OldTargetApi' 
      //Lint gives this warning but SDK 20 would be Android L Beta. 
      disable 'IconDensities'      //For testing purpose. This is safe to remove. 
      disable 'IconMissingDensityFolder' //For testing purpose. This is safe to remove. 
    } 
 
 
    dexOptions { 
      javaMaxHeapSize "8G" 
    } 
 
    packagingOptions { 
      exclude 'LICENSE.txt' 
      exclude 'META-INF/DEPENDENCIES.txt' 
      exclude 'META-INF/LICENSE.txt' 
      exclude 'META-INF/NOTICE.txt' 
      exclude 'META-INF/NOTICE' 
      exclude 'META-INF/LICENSE' 
      exclude 'META-INF/DEPENDENCIES' 
      exclude 'META-INF/notice.txt' 
      exclude 'META-INF/license.txt' 
      exclude 'META-INF/dependencies.txt' 
      exclude 'META-INF/rxjava.properties' 
    } 
 
    sourceSets { 
      main.java.srcDirs += 'build/generated/source/apt' 
    } 
  } 
 
  repositories { 
    flatDir { 
      dirs 'libs' 
    } 
  } 
 
  dependencies { 
  implementation fileTree(dir: 'libs', include: ['*.jar'])  
  implementation project(':library_api') 
  implementation project(':library_base') 
  implementation project(':library_blur_dialog') 
  implementation project(':library_countrycodepicker_dialog') 
  implementation project(':library_glow_decorator') 
  implementation project(':library_icons') 
  implementation project(':library_loopvideo') 
  implementation project(':library_section_adaper') 
  implementation project(':library_taptargetview') 
  implementation project(':library_ucrop') 
  implementation project(':library_utils') 
  implementation project(':library_utils_picasso') 
  implementation project(':library_vector_compat') 
  implementation project(':library_view_clock') 
  implementation project(':library_view_shimmer_recycler') 
 
  implementation "com.google.android.gms:play-services-cast-framework:11.4.2" 
  compileOnly 'com.google.android.wearable:wearable:2.0.3' 
  implementation 'com.google.android.support:wearable:2.0.3' 
  implementation 'com.google.android.exoplayer:exoplayer:r2.4.1' 
 
  implementation "com.android.support:mediarouter-v7:25.4.0" 
  implementation "com.android.support:leanback-v17:25.4.0" 
  implementation "com.android.support:design:25.4.0" 
 
  implementation "com.android.support:appcompat-v7:25.4.0" 
  implementation "com.android.support:support-v4:25.4.0" 
  implementation "com.android.support:gridlayout-v7:25.4.0" 
  implementation "com.android.support:cardview-v7:25.4.0" 
  implementation "com.android.support:recyclerview-v7:25.4.0" 
  implementation "com.android.support:preference-v14:25.4.0" 
 
  // rxjava 
  implementation 'io.reactivex:rxjava:1.2.9' 
  implementation 'io.reactivex:rxandroid:1.2.1' 
  implementation 'com.github.davidmoten:rxjava-extras:0.8.0.6' 
 
  // square 
  implementation "com.squareup.retrofit2:retrofit:2.1.0", 
  implementation "com.squareup.retrofit2:converter-gson:2.1.0" 
  implementation "com.squareup.retrofit2:adapter-rxjava:2.1.0" 
  implementation "com.squareup.phrase:phrase:1.1.0" 
 
  implementation "com.squareup.okhttp3:okhttp:3.6.0" 
  implementation "com.squareup.okhttp3:logging-interceptor:3.6.0" 
  implementation "com.squareup.okhttp3:okhttp-urlconnection:3.6.0" 
 
  // picasso 
  implementation "com.squareup.picasso:picasso:2.5.2" 
  implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' 
 
  // dagger 
  implementation "com.google.dagger:dagger:2.10" 
  annotationProcessor "com.google.dagger:dagger-compiler:2.10" 
  implementation "javax.annotation:jsr250-api:1.0" 
  implementation "javax.inject:javax.inject:1" 

  // jake ftw 
  implementation 'com.jakewharton:butterknife:8.8.1' 
  annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'  
  compileOnly 'org.projectlombok:lombok:1.16.16' 
  annotationProcessor 'org.projectlombok:lombok:1.16.16'  
  // FragmentWithArgs 
  implementation  "com.hannesdorfmann.fragmentargs:annotation:3.0.2", 
  annotationProcessor "com.hannesdorfmann.fragmentargs:processor:3.0.2",  
  implementation "org.parceler:parceler-api:1.1.9", 
  annotationProcessor "org.parceler:parceler:1.1.9", 
  implementation 'com.hannesdorfmann.fragmentargs:bundler-parceler:3.0.2' 
   implementation "com.github.codekidX:storage-chooser:1.0.34"  
  implementation 'io.github.yavski:fab-speed-dial:1.0.6'  
  implementation('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') { 
    transitive = true; 
  } 
 
  // intent builder 
  implementation     "com.github.marcinmoskala.activitystarter:activitystarter:1.00" 
  annotationProcessor "com.github.marcinmoskala.activitystarter:activitystarter-compiler:1.00"  
  implementation 'com.android.support.constraint:constraint-layout:1.0.2'//constraint-layout 
  implementation 'org.greenrobot:eventbus:3.0.0' 
  //font 
  implementation 'uk.co.chrisjenx:calligraphy:2.2.0' 
  implementation 'com.github.florent37:expectanim:1.0.6' 
  implementation 'com.romandanylyk:pageindicatorview:0.2.0@aar' 
  implementation 'com.github.rubensousa:gravitysnaphelper:1.2' 
  implementation 'com.flaviofaria:kenburnsview:1.0.7' 
  implementation 'com.github.florent37:arclayout:1.0.2'  
  implementation 'com.jakewharton.rxbinding:rxbinding:1.0.1' 
  implementation 'com.wang.avi:library:2.1.3' 
  implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' 
  implementation 'com.borax12.materialdaterangepicker:library:1.9' 
  implementation 'com.github.scottyab:showhidepasswordedittext:0.8' 
  //Location 
  implementation "com.google.android.gms:play-services-maps:11.4.2" 
  implementation 'pl.charmas.android:android-reactive-location:0.10@aar' 
  implementation "com.google.android.gms:play-services-location:11.4.2" 
  //you can use newer GMS version if you need 
  implementation "com.google.android.gms:play-services-places:11.4.2" 
  implementation 'com.tbruyelle.rxpermissions:rxpermissions:0.9.4@aar' 
  implementation 'commons-validator:commons-validator:1.4.1' 
  implementation 'com.balysv:material-ripple:1.0.2' 
  implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2' 
  implementation 'ru.egslava:MaskedEditText:1.0.5' 
  implementation 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'  
  implementation "com.google.firebase:firebase-core:11.4.2" 
  implementation 'com.labo.kaji:swipeawaydialog:0.1.1' 
  implementation 'io.supercharge:shimmerlayout:1.0.1' 
  implementation 'hanks.xyz:htextview-library:0.1.5' 
  implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'//progressbar for action bar 
  implementation 'io.reactivex:rxjava-math:1.0.0' 
  implementation 'jp.wasabeef:picasso-transformations:2.1.2' 
  implementation 'com.afollestad.material-dialogs:core:0.9.1.0' 
  implementation('com.github.ihsanbal:LoggingInterceptor:2.0.2') { 
    exclude group: 'org.json', module: 'json' 
  }  
} 

項(xiàng)目(project)目錄下build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
 
buildscript { 
  repositories { 
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 
    maven { 
      url 'https://maven.google.com/' 
      name 'Google' 
    } 
    jcenter() 
//    maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } 
  } 
  dependencies { 
    classpath 'com.android.tools.build:gradle:3.0.1' 
    classpath 'com.meituan.android.walle:plugin:1.1.1' 
    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
  } 
} 
 
allprojects { 
  repositories { 
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } 
//    maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' } 
    maven { url "https://jitpack.io" } 
    maven { url 'https://maven.google.com' } 
    maven { url "https://dl.google.com/dl/android/maven2/"} 
    jcenter() 
    google() 
  } 
} 
 
task clean(type: Delete) { 
  delete rootProject.buildDir 
} 
 
 
ext { 
  targetSdkVersion = 26 
  minSdkVersion = 14 
  compileSdk = 26 
  buildTools = "26.0.2" 
  junit = 'junit:junit:4.12' 
  recyclerview = 'com.android.support:recyclerview-v7:26.0.2' 
  appcompat = 'com.android.support:appcompat-v7:26.0.2' 
  design = 'com.android.support:design:26.0.2' 
  percent = 'com.android.support:percent:26.0.2' 
  glide = 'com.github.bumptech.glide:glide:3.7.0' 
  retrofit = 'com.squareup.retrofit:retrofit:1.9.0' 
  gson = 'com.google.code.gson:gson:2.8.0' 
  okhttp = 'com.squareup.okhttp3:okhttp:3.6.0' 
//  converterGson = 'com.squareup.retrofit:converter-gson:2.0.0-beta2' 
//  converterJackson = 'com.squareup.retrofit:converter-jackson:1.9.0' 
   
  commonsio = 'commons-io:commons-io:2.4' 
} 

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • android studio的安裝(史上最詳細(xì))

    android studio的安裝(史上最詳細(xì))

    這篇文章主要介紹了android studio的安裝(史上最詳細(xì)),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-12-12
  • Android?Activity啟動(dòng)流程刨析

    Android?Activity啟動(dòng)流程刨析

    Activity作為Android四大組件之一,他的啟動(dòng)絕對(duì)沒有那么簡(jiǎn)單。這里涉及到了系統(tǒng)服務(wù)進(jìn)程,啟動(dòng)過(guò)程細(xì)節(jié)很多,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值
    2022-08-08
  • Android開發(fā)之RecyclerView控件

    Android開發(fā)之RecyclerView控件

    本文給大家介紹的是Android開發(fā)中常用的RecyclerView控件的使用方法以及簡(jiǎn)單的特性,有需要的小伙伴可以參考下
    2016-02-02
  • Android仿微信圖片點(diǎn)擊全屏效果

    Android仿微信圖片點(diǎn)擊全屏效果

    這篇文章主要為大家詳細(xì)介紹了Android仿微信圖片點(diǎn)擊全屏效果的相關(guān)資料,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-04-04
  • Android性能優(yōu)化及性能優(yōu)化工具

    Android性能優(yōu)化及性能優(yōu)化工具

    這篇文章主要給大家分享的是Android性能優(yōu)化及性能優(yōu)化工具,下面文字會(huì)圍繞Android性能優(yōu)化的相關(guān)資料詳細(xì)的展開具體內(nèi)容,需要的朋友可以參考一下,希望對(duì)大家有所幫助
    2021-11-11
  • 深入解析Android中的事件傳遞

    深入解析Android中的事件傳遞

    這篇文章主要介紹了關(guān)于Android中的事件傳遞,文中介紹的非常詳細(xì),相信對(duì)大家具有一定的參考價(jià)值,需要的朋友們下面來(lái)一起看看吧。
    2017-03-03
  • Android分享微信小程序技巧之圖片優(yōu)化

    Android分享微信小程序技巧之圖片優(yōu)化

    這篇文章主要給大家介紹了關(guān)于Android分享微信小程序技巧之圖片優(yōu)化的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2018-11-11
  • Android屏幕手勢(shì)檢測(cè)的實(shí)現(xiàn)代碼

    Android屏幕手勢(shì)檢測(cè)的實(shí)現(xiàn)代碼

    這篇文章主要介紹了Android屏幕手勢(shì)檢測(cè)的實(shí)現(xiàn)代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2017-11-11
  • Android PopupWindow增加半透明蒙層

    Android PopupWindow增加半透明蒙層

    這篇文章主要為大家詳細(xì)介紹了Android PopupWindow增加半透明蒙層,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-10-10
  • 如何安裝系統(tǒng)認(rèn)證簽名過(guò)的APK

    如何安裝系統(tǒng)認(rèn)證簽名過(guò)的APK

    如果你的App因?yàn)闄?quán)限原因需要設(shè)置 android:sharedUserId="android.uid.system" 那么IDE編譯出的包通常是無(wú)法直接安裝的,查看控制臺(tái)會(huì)發(fā)現(xiàn)報(bào) INSTALL_FAILED_SHARED_USER_INCOMPATIBLE錯(cuò)誤。這是必須的,隨隨便便一個(gè)App聲明一下就可以和系統(tǒng)用戶共享ID,豈不亂套了?
    2014-07-07

最新評(píng)論