首页 > 解决方案 > “重复课程”是什么意思?

问题描述

我在运行我的应用程序时遇到问题。突然之间,该应用程序开始产生此错误“duplicate class com.google.android.gms.location.places”。而且我什至不是在开玩笑,我一直在搜索整个站点以修复此错误,甚至删除了所有项目并创建了一个新项目。但没有,没有。什么都解决不了!

我相信我一直在阅读有关该主题的每个主题。Ofc,那里有解决方案!它恰好不是我的正确解决方案......

这是错误行:

Duplicate class com.google.android.gms.location.places.zza found in modules classes.jar (com.google.android.gms:play-services-places-placereport:16.0.0) and classes.jar (com.google.android.gms:play-services-places:9.6.1)

这是我的依赖项和 app.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.4.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {url 'https://jitpack.io'}

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

应用程序.gradle

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 28
        defaultConfig {
            applicationId "com.example.qwisenow"
            minSdkVersion 22
            targetSdkVersion 28
            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.android.support:appcompat-v7:28.0.0'
        implementation 'com.google.android.gms:play-services-maps:16.0.0'
        implementation 'com.google.android.gms:play-services-location:16.0.0'   // FusedLocationProviderClient
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        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.stripe:stripe-android:8.7.0'            
        implementation 'com.github.f0ris.sweetalert:library:1.5.6'  
        implementation 'com.ebanx:swipe-button:0.8.3'               
        implementation 'me.dm7.barcodescanner:zxing:1.9.13'         
        implementation 'com.braintreepayments:card-form:3.1.1'      
        implementation 'com.github.aarsy.googlemapsanimations:googlemapsanimations:1.0.5'
        implementation 'com.android.support:cardview-v7:28'         
        implementation 'com.vipulasri:ticketview:1.0.7' 
        implementation 'me.philio:pinentryview:1.0.6'   
        implementation 'com.github.ar-android:DrawRouteMaps:1.0.0'  
        implementation 'com.codemybrainsout.onboarding:onboarder:1.0.4'     
        implementation 'com.karumi:dexter:5.0.0'    
    }

任何人都可以看到那里看起来“重复”的东西吗?我不能,我已经尝试了大约 30 种解决方案,但 Android Studio 不断给我错误......

标签: android

解决方案


推荐阅读