java - 重复类 com.google.android.gms Android Studio 的问题

标签 java android gradle build

我有一个问题: 在模块 classes.jar (com.google.android.gms:play-services-base:9.4.0) 和 classes.jar (com.google.android .gms:play-services-basement:16.0.1)

您有解决此错误的想法吗?

我给你我的应用程序 bluid.gradle ....

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'


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

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

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

android {
    compileSdkVersion 23
    defaultConfig {
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        applicationId "fr.appli.test"
        minSdkVersion 16
        targetSdkVersion 23
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test:runner:0.5') {
        exclude group: 'com.android.support', module: 'support-annotations'
        implementation 'com.google.android.gms:play-services-ads:17.2.0'
    }
    androidTestImplementation 'com.android.support.test:rules:0.4'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestImplementation ('com.android.support.test.espresso:espresso-contrib:2.2') {
        exclude module: 'support-annotations'
        exclude module: 'support-v4'
        exclude module: 'support-v13'
        exclude module: 'recyclerview-v7'
    }
    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
    androidTestImplementation 'com.android.support:support-annotations:23.4.0
    implementation 'com.android.support:preference-v14:23.4.0'
    implementation 'com.android.support:design:23.4.0'
    implementation 'com.android.support:cardview-v7:23.4.0'
    implementation 'com.android.support:recyclerview-v7:23.4.0'
    implementation 'com.google.android.gms:play-services-location:9.4.0'
    implementation 'com.google.android.gms:play-services-maps:9.4.0'
    implementation 'com.adobe.xmp:xmpcore:5.1.2'
    implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.4.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
}

预先感谢您的帮助

最佳答案

您正在使用这些的旧版本

implementation 'com.google.android.gms:play-services-location:9.4.0'
implementation 'com.google.android.gms:play-services-maps:9.4.0'

尝试这些较新的版本

implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'

关于java - 重复类 com.google.android.gms Android Studio 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56456277/

相关文章:

java - Android Studio 上 Kotlin(非 Android)项目的 ClassNotFoundException 错误

android - 无法解决 : com. crashlytics.sdk.android :answers-shim:0. 0.3

java - 在 jboss 7.0.0 GA 中启用 TLSv1.3

java - HashMap.clear() 减少内存?

android - OAuth2 服务器设置 'client_id' 广告 '' client_secret' 为 'password' 授予类型

带有页面指示器的Android滚动条分页

gradle - 执行Gradle构建时如何跳过初始化脚本

java - 使用 java.lang.reflect.Array.newInstance 通过 Java 反射创建二维数组

java - Spring 中@Repository 和@RepositoryDe​​finition 有什么区别?

android - shell脚本不会被执行