迁移到New Places SDK客户端

时间:2019-02-10 02:26:04

标签: android-studio google-places-api googleplacesautocomplete

当我添加gradle依赖实现时,'com.google.android.libraries.places:位置:1.0.0'

我继续错误:Java编译器错误:无法访问“隐藏”

org.gradle.api.internal.tasks.compile.CompilationFailedException:编译失败;有关详细信息,请参见编译器错误输出。

这是我的依赖项列表:

  apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {


    compileSdkVersion 26
    buildToolsVersion '26.0.3'
    defaultConfig {
        applicationId 'com.test.pass'
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 13
        versionName '1.0.3'
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        dexOptions {
            javaMaxHeapSize '4g'
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

dependencies {
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.google.code.findbugs'
    })
    compile('com.mikepenz:fastadapter:2.0.0@aar') {
        transitive = true
    }
    compile 'com.afollestad.material-dialogs:core:0.9.0.0'
    compile 'com.mikepenz:iconics-core:2.8.1@aar'
    compile 'com.mikepenz:fontawesome-typeface:4.6.0.2@aar'

    compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
        exclude module: 'support-v4'
    }
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'

    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:support-vector-drawable:26.1.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.guava:guava:19.0'
    compile 'com.dmitrymalkovich.android:material-design-dimens:1.4'
    compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
    compile 'com.jakewharton:butterknife:8.4.0'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.google.firebase:firebase-core:12.0.1'
    compile 'com.google.firebase:firebase-messaging:12.0.1'
    compile 'com.mobsandgeeks:android-saripaar:2.0.3'
    compile 'com.google.android.gms:play-services:12.0.1'
    compile 'org.greenrobot:eventbus:3.1.0'
    compile 'com.makeramen:roundedimageview:2.2.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.github.siyamed:android-shape-imageview:0.9.3'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.balysv:material-ripple:1.0.2'

}
dependencies {
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
}

dependencies {
    implementation 'com.google.android.libraries.places:places:1.0.0'
}


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

这是我的项目级别gradle文件:

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'io.realm:realm-gradle-plugin:4.1.0'

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

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

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

1 个答案:

答案 0 :(得分:0)

将此添加到您gradle下的应用dependencies文件中:

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

这不是我的解决方案,我是从SO的其他人那里得到的,但是找不到那个问题。我将在稍后将链接添加到该帖子。

编辑:Original Answer