2017-03-07 1 views
2

Android Studio를 2.2.3에서 2.3으로 업데이트했습니다. 업데이트를 마친 후 내 프로젝트가 시작되어 빌드 충돌이 발생합니다. 모든 com.android.support 라이브러리 동일한 버전 사양을 사용해야합니다 (믹싱 버전으로 인해 런타임 충돌이 발생할 수 있음). 찾을 버전 25.2.0, 25.0.2업데이트 후 안드로이드 2.3에서 Bulbles to Prod 프로젝트. '모든 com.android.support 라이브러리는 정확히 동일한 버전을 사용해야합니다.'

응용 프로그램 모듈 프로젝트 build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.0' 
     classpath 'com.google.gms:google-services:3.0.0' 
     // replace with the current version of the android-apt plugin 
     classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 
     classpath 'me.tatarka:gradle-retrolambda:3.2.4' 
     classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
    configurations.classpath.exclude group: 'com.android.tools.external.lombok' 
} 

allprojects { 
    repositories { 
     jcenter() 
     jcenter() 
     mavenCentral() 
     maven { url 'http://repo.spring.io/milestone' } 
     maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } 
    } 
    configurations.all { 
     resolutionStrategy.cacheChangingModulesFor 0, 'seconds' 
     resolutionStrategy { 
      force 'com.android.support:support-annotations:25.2.0' 
     } 
    } 
} 

def getDate() { 
    def date = new Date() 
    def formattedDate = date.format('yyyyMMdd-HHmm') 
    return formattedDate 
} 

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

API 모듈 build.gradle

apply plugin: 'com.android.application' 
apply plugin: 'com.neenbedankt.android-apt' 
def AAVersion = '4.2.0' 
apply plugin: 'io.fabric' 


apt { 
    arguments { 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
    } 
} 
buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     // The Fabric Gradle plugin uses an open ended version to react 
     // quickly to Android tooling updates 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
repositories { 
    maven { 
     url "https://jitpack.io" 
    } 
    maven { 
     url "https://oss.sonatype.org/content/repositories/snapshots" 
    } 
    maven { 
     url 'https://zendesk.artifactoryonline.com/zendesk/repo' 
    } 
    maven { 
     url 'https://maven.fabric.io/public' 
    } 
} 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 

    defaultConfig { 
     applicationId "amaro.amaroandroid" 
     minSdkVersion 21 
     targetSdkVersion 25 
     renderscriptTargetApi 25 
     renderscriptSupportModeEnabled true 
     versionCode 6 
     versionName "1.01" 
     //Instrumentation Test Runner 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     // Enabling multidex support. 
     multiDexEnabled true 
     manifestPlaceholders = [manifestApplicationId   : "${applicationId}", 
           onesignal_app_id    : "32551ffc-b35d-482f-81c7-2c4206811814", 
           onesignal_google_project_number: "867653264688"] 
     vectorDrawables.useSupportLibrary = true 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/ASL2.0' 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 

    dexOptions { 
     preDexLibraries = false 
     javaMaxHeapSize "2g" 
    } 

} 

afterEvaluate { 
    tasks.matching { 
     it.name.startsWith('dex') 
    }.each { dx -> 
     if (dx.additionalParameters == null) { 
      dx.additionalParameters = [] 
     } 
     dx.additionalParameters += '--multi-dex' 
     dx.additionalParameters += "--main-dex-list=$projectDir/multidex.keep".toString() 
    } 
} 
allprojects { 
    repositories { 
     mavenCentral() 
    } 
} 
dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile project(':api') 

    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 

    compile group: 'com.zopim.android', name: 'sdk', version: '1.3.2.1' 
    // Required for geotagging 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile 'com.google.maps.android:android-maps-utils:0.4.+' 
    compile 'com.android.support:recyclerview-v7:25.2.0' 
    compile 'com.android.support:appcompat-v7:25.2.0' 
    compile 'com.android.support:design:25.2.0' 
    compile 'com.android.support:cardview-v7:25.2.0' 
    compile 'org.jsoup:jsoup:1.10.2' 
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.5' 
    compile 'com.mikepenz:iconics-core:[email protected]' 
    compile 'com.mikepenz:google-material-typeface:[email protected]' 
    compile 'com.mikepenz:material-design-iconic-typeface:[email protected]' 
    compile 'com.mikepenz:fontawesome-typeface:[email protected]' 
    compile 'com.mikepenz:octicons-typeface:[email protected]' 
    compile 'com.mikepenz:meteocons-typeface:[email protected]' 
    compile 'com.mikepenz:community-material-typeface:[email protected]' 
    compile 'com.mikepenz:weather-icons-typeface:[email protected]' 
    compile 'com.mikepenz:typeicons-typeface:[email protected]' 
    compile 'com.mikepenz:entypo-typeface:[email protected]' 
    compile 'com.mikepenz:devicon-typeface:[email protected]' 
    compile 'com.mikepenz:foundation-icons-typeface:[email protected]' 
    compile 'com.mikepenz:ionicons-typeface:[email protected]' 
    compile 'com.github.Yalantis:Context-Menu.Android:v1.0.4' 
    compile 'com.astuetz:pagerslidingtabstrip:1.0.1' 
    compile 'com.android.support.test.espresso:espresso-contrib:2.2.2' 
    compile 'com.rengwuxian.materialedittext:library:2.1.4' 
    compile 'com.github.medyo:fancybuttons:1.8.3' 
    compile 'com.yarolegovich:lovely-dialog:1.0.4' 
    compile 'com.wang.avi:library:1.0.5' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.github.traex.rippleeffect:library:1.3' 
    compile 'com.balysv:material-ripple:1.0.2' 
    compile 'com.mikepenz:actionitembadge:[email protected]' 
    compile 'com.github.linger1216:labelview:v1.1.1' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.onesignal:OneSignal:[email protected]' 
    compile 'com.google.android.gms:play-services-places:10.2.0' 
    compile 'com.google.android.gms:play-services-location:10.2.0' 
    compile 'com.google.android.gms:play-services-analytics:10.2.0' 
    compile 'com.android.support:support-v4:25.2.0' 
    compile 'com.github.rahatarmanahmed:circularprogressview:2.5.0' 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.mockito:mockito-core:1.+' 
    androidTestCompile 'com.android.support:support-annotations:25.2.0' 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    androidTestCompile 'com.android.support.test:rules:0.5' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
    androidTestCompile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2' 
    androidTestCompile 'org.mockito:mockito-core:1.+' 
    androidTestCompile 'com.google.dexmaker:dexmaker:1.2' 
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' 
} 

build.gradle

apply plugin: 'com.android.library' 
apply plugin: 'me.tatarka.retrolambda' 
apply plugin: 'com.neenbedankt.android-apt' 
def AAVersion = '4.2.0' 

apt { 
    arguments { 
     androidManifestFile variant.outputs[0]?.processResources?.manifestFile 
    } 
} 
android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 

    defaultConfig { 
     minSdkVersion 21 
     targetSdkVersion 25 
     multiDexEnabled true 
     versionCode 1 
     versionName "1.0" 
    } 

    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/ASL2.0' 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      buildConfigField "String", "SHARE_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"https://amaro.com\"" 
      buildConfigField "String", "API_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"https://amaro.com/shop/api/\"" 
      buildConfigField "String", "DEV_API_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"https://amaro.com/shop/api/\""//https://amaro.com/shop/api/ 
      buildConfigField "String", "SESSION", "\"_aecp\""//_aecp 
      buildConfigField "String", "AUTHENTICATION", "\"_aecp_user\""//_aecp_user 
     } 
     debug { 
      minifyEnabled false 
      debuggable true 
      buildConfigField "String", "SHARE_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"https://amaro.com\"" 
      buildConfigField "String", "API_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"https://amaro.com/shop/api/\"" 
      buildConfigField "String", "DEV_API_URL", System.getenv("RSAPIURL") ? "\"" + System.getenv("RSAPIURL") + "\"" : "\"http://dev.amaro.com/shop/api/\""// 
      buildConfigField "String", "SESSION", "\"_aecp_dev\""//_aecp_dev 
      buildConfigField "String", "AUTHENTICATION", "\"_aecp_dev_user\""//_aecp_dev_user 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 

    apt "org.androidannotations:androidannotations:$AAVersion" 
    compile "org.androidannotations:androidannotations-api:$AAVersion" 
    compile "org.projectlombok:lombok:1.16.6" 

    apt "org.androidannotations:rest-spring:$AAVersion" 
    compile "org.androidannotations:rest-spring-api:$AAVersion" 
    compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3' 

    compile "commons-lang:commons-lang:2.6" 

    compile "com.j256.ormlite:ormlite-jdbc:4.48" 
    compile "com.j256.ormlite:ormlite-android:4.48" 
    compile "org.jdeferred:jdeferred-core:1.2.2" 
    compile "org.javamoney:moneta-bp:1.0" 

    compile 'com.fasterxml.jackson.core:jackson-core:2.1.0' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.1.0' 
    compile 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.1.0' 

    compile 'com.squareup:otto:1.3.8' 
} 
+0

모든 파일에 25.2.0에 buildToolsVersion을 변경 시도가 있어야 모듈의 build.gradle에서

ext { supportlib_version = '25.2.0' ... } ... subprojects { project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == 'com.android.support' && !details.requested.name.contains('multidex')) { details.useVersion "$supportlib_version" } } } } ... 

을 가져야한다 –

+0

당신은 대체 할 수있다 당신'''afterEvaluate {...}''' ''' dexOptions { additionalParameters "--multi - 덱스 --main - 덱스 목록 = $ PROJECTDIR/multidex.keep"와 } ''' – shily

+0

buildtools를 25.2.0 @GabeSechan으로 바꾸면 무슨 뜻입니까? 모든 파일은 마지막 버전을 사용하고 있습니다. –

답변

0

해결되었습니다!

루트 build.gradle에서

, 당신은

dependencies { 
    compile "com.android.support:appcompat-v7:25.2.0" 
    compile "com.android.support:recyclerview-v7:25.2.0" 
    ... 
} 
관련 문제