所有支持库都有相同的versioin Android?

时间:2018-02-01 11:28:46

标签: android android-support-library

我有相同版本的库仍然会给出相同的错误。

它在第一次库实现时给出了错误' com.android.support:support-compat:27.0.2'。

gradle中有什么遗漏吗?

我可以成功运行构建,但它会出错。

我提到一些问题,但仍然是同一个问题。

我也在链接下面徘徊

All com.android.support libraries must use the exact same version specification

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        jcenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.1'
        classpath 'com.malmstein:fenster:0.0.2'
        classpath 'me.tatarka:gradle-retrolambda:3.6.1'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
    }
}

// Required because retrolambda is on maven central
repositories {
    mavenCentral()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven { url 'https://maven.google.com' }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.app.readyb"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        signingConfig signingConfigs.debug
    }
    signingConfigs {
        release {
            storeFile file('C:/MyFolder/OrdexAndroid/ORDEXWORK/ReadyB/Keystore/xx.jks')
            storePassword 'xx'
            keyAlias 'xxxx'
            keyPassword 'xxxx'
        }
        debug {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storeFile file('C:/Users/BHARATI/.android/debug.keystore')
            storePassword 'android'
        }
    }
    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'boolean', 'CRASHLYTICS_ENABLED', 'false'
            signingConfig signingConfigs.debug
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField 'boolean', 'CRASHLYTICS_ENABLED', 'true'
            signingConfig signingConfigs.release
        }
    }
    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // support libraries
    implementation 'com.android.support:support-compat:27.0.2'
    implementation 'com.android.support:support-core-ui:27.0.2'
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:animated-vector-drawable:27.0.2'
    implementation 'com.android.support:support-v13:27.0.2'
    implementation 'com.android.support:mediarouter-v7:27.0.2'
    implementation 'com.android.support:customtabs:27.0.2'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.android.support:gridlayout-v7:27.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support:support-annotations:27.0.2'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:multidex:1.0.2'
    // RxJava
    implementation 'io.reactivex.rxjava2:rxjava:2.1.2'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
    implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
    implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.0.0'
    implementation 'com.trello.rxlifecycle2:rxlifecycle:2.1.0'
    implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.1.0'
    implementation 'com.f2prateek.rx.preferences2:rx-preferences:2.0.0-RC3'
    // net
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.google.code.gson:gson:2.8.1'
    // dependency injection
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    // dagger
    implementation 'com.google.dagger:dagger:2.11'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
    provided 'javax.annotation:jsr250-api:1.0'
    // event bus
    implementation 'org.greenrobot:eventbus:3.0.0'
    // boilerplate generation
    implementation 'org.glassfish:javax.annotation:10.0-b28'
    provided 'org.projectlombok:lombok:1.16.18'
    annotationProcessor 'org.projectlombok:lombok:1.16.18'
    // image loading
    implementation 'com.github.bumptech.glide:glide:4.4.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
    // fabric crashlytis library
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    // joda date time library
    implementation 'net.danlew:android.joda:2.9.9.1'
    // ACProgressLite progress dialog
    implementation 'cc.cloudist.acplibrary:library:1.2.1'
    // top snackbar
    implementation 'com.androidadvance:topsnackbar:1.1.1'
    // activation code library
    implementation 'online.devliving:passcodeview:1.0.3'
    // android stripe api
    implementation 'com.stripe:stripe-android:6.0.0'
    // java stripe api
    implementation 'com.stripe:stripe-java:5.7.1'
    // for aws image upload
    implementation 'com.amazonaws:aws-android-sdk-core:2.4.6'
    implementation 'com.amazonaws:aws-android-sdk-s3:2.4.6'
    implementation 'com.amazonaws:aws-android-sdk-ddb:2.4.6'

    // for crop image after select or capture image
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    // rxpermission for android device
    implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
    // facebook
    implementation 'com.facebook.android:facebook-android-sdk:4.23.0'
    // twitter
    implementation('com.twitter.sdk.android:twitter:2.3.1@aar') {
        transitive = true
    }
    // video play
    implementation 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
    // view pager indicator
    implementation 'com.romandanylyk:pageindicatorview:0.2.0'
    implementation 'com.romandanylyk:pageindicatorview:0.2.0@aar'

    // expandable list view like pager
    implementation 'com.diegocarloslima:fgelv:0.1.2@aar'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'

    // full screen dialog
    implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'

    // material date time picker
    //compile 'com.wdullaer:materialdatetimepicker:3.3.1'
    implementation ('com.wdullaer:materialdatetimepicker:3.4.0') {
        exclude group: 'com.android.support'
    }

    // capturing video
    implementation 'com.otaliastudios:cameraview:1.4.1'

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

1 个答案:

答案 0 :(得分:1)

这可能是因为某些依赖项正在使用其他版本。您可以强制使用特定版本

configurations.all {
  resolutionStrategy {
      force 'library which you need to force'
  }
}