Skip to main content
se añadieron 41 caracteres en el cuerpo
Origen Enlace
Jorgesys
  • 111.1k
  • 14
  • 55
  • 134
apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        disable 'MissingTranslation'
    }
}

dependencies {
    api files('libs/OoyalaSDK.aar')
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.appnexus.opensdk:appnexus-sdk:4.5'
    implementation('com.crashlytics.sdk.android:answers:1.4.2@aar') {
        transitive = true;
    }
}
apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        disable 'MissingTranslation'
    }
}

dependencies {
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.appnexus.opensdk:appnexus-sdk:4.5'
    implementation('com.crashlytics.sdk.android:answers:1.4.2@aar') {
        transitive = true;
    }
}
apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        disable 'MissingTranslation'
    }
}

dependencies {
    api files('libs/OoyalaSDK.aar')
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.appnexus.opensdk:appnexus-sdk:4.5'
    implementation('com.crashlytics.sdk.android:answers:1.4.2@aar') {
        transitive = true;
    }
}
Origen Enlace
Jorgesys
  • 111.1k
  • 14
  • 55
  • 134

Problema al construir aplicación : "You should manually set the same version via DependencyResolution"

Acabo de actualizar uno de mis proyectos cambiando las dependencias a nuevas versiones, pero ahora tengo un problema me indica que la construcción fallo (Build failed) y me muestra en la pantalla de Build el siguiente mensaje de error:

Android dependency 'com.android.support:cardview-v7' has different version for the compile (27.0.2) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution

Mi archivo build.gradle es el siguiente:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}

repositories { 
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
    google()
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "xxx.xxxxxxxxxx.fussbal"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 25
        versionName '1.8.3'
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    dexOptions {
        javaMaxHeapSize "2048M"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }
    lintOptions {
        disable 'MissingTranslation'
    }
}

dependencies {
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':AndRoboDroid')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    //implementation 'com.squareup.okhttp:okhttp:2.5.0'
    //implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    //implementation 'com.google.android.gms:play-services-base:11.6.0'
    implementation 'com.google.android.gms:play-services-ads:12.0.0'
    implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
        transitive = true;
    }
}

apply plugin: 'com.google.gms.google-services'

cabe destacar que la library AndRoboDroid ( implementation project(':AndRoboDroid')) a la que se hace referencia en el archivo build.gradle principal, también fue actualizada a :

apply plugin: 'com.android.library'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 26
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        disable 'MissingTranslation'
    }
}

dependencies {
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.appnexus.opensdk:appnexus-sdk:4.5'
    implementation('com.crashlytics.sdk.android:answers:1.4.2@aar') {
        transitive = true;
    }
}

Esto es lo que he realizado con la configuración anterior:

  • Asegure en todo el proyecto no tener versiones 27.0.2 como indica el error.
  • Reinicié la IDE.
  • Limpie el proyecto, incluso elimine el contenido de los directorio /build