【问题标题】:In project 'app' a resolved Google Play services library dependency depends on another在项目“应用程序”中,已解决的 Google Play 服务库依赖项依赖于另一个
【发布时间】:2019-09-09 12:34:22
【问题描述】:

错误:在项目“应用程序”中,已解决的 Google Play 服务库依赖项依赖于另一个确切版本的依赖项(例如“[15.0. 1]",但没有被解析为该版本。库表现出的行为将是未知的。

依赖失败:com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-base@[15.0 .1],但 play-services-base 版本是 16.0.1。

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

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.android.studentattendance"
        minSdkVersion 22
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.android.gms:play-services-auth:9.8.0'
    implementation 'com.google.android.gms:play-services-location:16.0.1'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.android.gms:play-services-auth-base:16.1.0'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

【问题讨论】:

    标签: android android-gradle-plugin dependencies google-play-services


    【解决方案1】:

    修改你的依赖列表。

    依赖{ 实现 fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-base:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.1'
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    

    }

    【讨论】:

      【解决方案2】:

      实现 'com.google.android.gms:play-services-auth:16.0.1' 实现 'com.google.android.gms:play-services-base:16.1.0'

      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.google.android.gms:play-services-flags:16.0.1'
      implementation 'com.google.android.gms:play-services-basement:16.2.0'
      implementation 'com.android.support.constraint:constraint-layout:1.1.3'
      implementation 'com.google.firebase:firebase-auth:16.2.1'
      implementation 'com.google.firebase:firebase-core:16.0.8'
      implementation 'com.google.android.gms:play-services-maps:16.1.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.2'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      implementation 'com.android.support:support-annotations:28.0.0'
      

      【讨论】:

      • 请您澄清一下您到底做了什么。如果是答案,答案根本不清楚。
      猜你喜欢
      • 2019-07-16
      • 2019-05-31
      • 2019-07-03
      • 2023-04-02
      • 2020-08-24
      • 2020-04-17
      • 1970-01-01
      • 1970-01-01
      • 2017-05-14
      相关资源
      最近更新 更多