Android版本问题

时间:2018-11-28 17:25:26

标签: android

我收到错误消息“请通过更新google-services插件的版本(有关最新版本的信息可从https://bintray.com/android/android-tools/com.google.gms.google-services/获得)或更新com.google.android.gms的版本来解决版本冲突。到16.0.5。”

Build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'org.jacoco:org.jacoco.core:0.8.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url = 'https://oss.sonatype.org/content/groups/public' }
        maven {
            url "https://maven.google.com"
        }
    }
}

configurations.all {
    transitive = true
}

Build.gradle

dependencies {
    implementation fileTree(include: '*.jar', dir: 'libs')
    implementation 'com.android.support:support-v13:27.1.0'
    implementation 'com.android.support:customtabs:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:exifinterface:27.1.0'
    implementation 'com.google.android.gms:play-services-analytics:16.0.5'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation('com.google.code.gson:gson:2.6.2') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation('com.google.http-client:google-http-client:1.22.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation('com.google.oauth-client:google-oauth-client:1.22.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation 'commons-io:commons-io:2.5'
    implementation 'net.sf.kxml:kxml2:2.3.0'
    implementation 'net.sf.opencsv:opencsv:2.3'
    implementation('org.opendatakit:opendatakit-javarosa:2.9.0') {
        exclude module: 'joda-time'
    }
    implementation 'org.osmdroid:osmdroid-android:5.6.4'
    implementation 'org.slf4j:slf4j-android:1.6.1-RC1'
    implementation 'pub.devrel:easypermissions:0.2.1'
    implementation('com.google.api-client:google-api-client-android:1.22.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation('com.google.apis:google-api-services-drive:v3-rev64-1.22.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation('com.google.apis:google-api-services-sheets:v4-rev463-1.22.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation 'com.jakewharton.timber:timber:4.6.0'
    implementation 'com.google.zxing:core:3.3.0'
    implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
    implementation 'net.danlew:android.joda:2.9.9'
    // Real LeakCanary for debug builds only: notifications, analysis, etc
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    // No-Op version of LeakCanary for release builds: no notifications, no analysis, nothing
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
    testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
    androidTestImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
    odkCollectReleaseImplementation group: 'com.squareup.leakcanary', name: 'leakcanary-android-no-op', version: '1.5.4'
    // Android Architecture Components:
    implementation 'android.arch.lifecycle:extensions:1.1.0'
    // Dagger:
    implementation 'com.google.dagger:dagger-android:2.11'
    implementation 'com.google.dagger:dagger-android-support:2.11'
    annotationProcessor 'com.google.dagger:dagger-android-processor:2.11'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.11'
    // RxJava 2:
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.10'
    // Better "Subjects" for Rx:
    implementation 'com.jakewharton.rxrelay2:rxrelay:2.0.0'
    // Android bindings for Rx:
    implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
    // RxLifecycle (binds subscription cleanup to component lifecycle):
    implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.1'
    implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.1'
    implementation 'com.trello.rxlifecycle2:rxlifecycle-android-lifecycle:2.2.1'
    // Makes binding to Views easy:
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    // Used to generate documentation screenshots.
    androidTestCompile 'tools.fastlane:screengrab:1.1.0'
    // Testing-only dependencies
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:2.8.47'
    testImplementation 'org.robolectric:robolectric:3.5.1'
    testImplementation 'org.robolectric:shadows-multidex:3.5.1'
    // power mock (for mocking final methods which is not handled by mockito)
    testImplementation 'org.powermock:powermock-module-junit4:1.6.4'
    testImplementation 'org.powermock:powermock-api-mockito2:1.7.3'
    androidTestImplementation 'org.mockito:mockito-android:2.11.0'
    androidTestImplementation('com.android.support.test:runner:1.0.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs', module: 'jsr305'
    }
    androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs', module: 'jsr305'
    }
    androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.9.0'
}

在gradle执行同步时,我也发现下载FireBase库时出错。我要升级旧版应用程序才能使用地理围栏API。

非常感谢。

1 个答案:

答案 0 :(得分:0)

在项目build.gradle中更新类路径“ com.google.gms:google-services:4.1.0”。