Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/235.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在模块中找到Android复制类com.google.Android.gms.location.places.zza_Android_Google Places - Fatal编程技术网

在模块中找到Android复制类com.google.Android.gms.location.places.zza

在模块中找到Android复制类com.google.Android.gms.location.places.zza,android,google-places,Android,Google Places,我正试图在我的项目中集成GoogleNewPlaceLibrary,因为旧的PlaceLibrary已被弃用。添加新的place librarycom.google.android.libraries.places:places:1.0.0后,将创建以下错误。如何解决此问题 Duplicate class com.google.android.gms.location.places.zza found in modules classes.jar (com.google.android.gms

我正试图在我的项目中集成GoogleNewPlaceLibrary,因为旧的PlaceLibrary已被弃用。添加新的place library
com.google.android.libraries.places:places:1.0.0
后,将创建以下错误。如何解决此问题

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:11.8.0)
下面是我的应用程序级渐变文件

apply plugin: 'com.android.application'

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

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
    applicationId "com.api.app"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 27
    versionName "1.5"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    manifestPlaceholders = [HOCKEYAPP_APP_ID: "51a9c4471559421b8d53a07cbb3e3fa0"]
    useLibrary 'org.apache.http.legacy'
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}

implementation ('com.google.android.libraries.places:places:1.0.0') {
    exclude group: 'com.github.bumptech.glide', module: 'glide'
}

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0-beta2'
implementation 'com.iarcuschin:simpleratingbar:0.1.5'
implementation 'com.google.code.gson:gson:2.8.1'

implementation "com.google.android.gms:play-services-maps:11.8.0"
implementation "com.google.android.gms:play-services-location:11.8.0"
implementation "com.google.android.gms:play-services-places:11.8.0"
implementation "com.google.firebase:firebase-auth:11.8.0"

implementation "com.google.firebase:firebase-messaging:11.8.0"
implementation "com.google.firebase:firebase-database:11.8.0" 
implementation "com.google.firebase:firebase-invites:11.8.0"
implementation "com.google.android.gms:play-services:11.8.0"

implementation 'com.android.support:multidex:1.0.1'
implementation 'com.hbb20:ccp:1.7.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'net.hockeyapp.android:HockeySDK:4.1.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.facebook.android:facebook-android-sdk:4.0.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.krtkush:LinearTimer:v2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.bumptech.glide:glide:3.6.1'

api "com.sothree.slidinguppanel:library:3.0.0" 
implementation 'com.google.maps.android:android-maps-utils:0.4'

implementation 'com.iarcuschin:simpleratingbar:0.1.5'
implementation 'com.paypal.sdk:paypal-android-sdk:2.15.3'
testImplementation 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'
下面是我的项目级gradle

buildscript {
repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
    google()


}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
    classpath 'com.google.gms:google-services:3.1.0'
}
}

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

project.ext {
supportVersion = '26.0.1'
googleVersion = '11.8.0'
}

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


task createWrapper(type: Wrapper) {
gradleVersion = '5.4.1'
}
不要

implementation ('com.google.android.libraries.places:places:1.0.0') {
    exclude group: 'com.github.bumptech.glide', module: 'glide'
}
你可以试试看

implementation "com.google.android.libraries.places:places:1.1.0"
用于Android的PlacesSDK的Google Play Services版本(即com.Google.Android.gms:Play Services Places)于2019年7月29日关闭,不再提供。Android PlacesSDK的新版本现已推出

Do

dependencies {

    implementation 'com.google.android.libraries.places:places:2.2.0'
}
阅读

供参考 您正在使用非常旧的版本。如果要使用最新版本,则除非在应用程序中进行以下更改,否则库将无法工作:

  • 将CompileSDK版本升级到28或更高版本
  • 更新应用程序以使用Jetpack(AndroidX)
AndroidX使用AndroidX命名空间中的包替换原始支持库API。请阅读有关的官方指南