错误:包com.google.android.gms.location.places.ui不存在

时间:2018-11-04 07:17:32

标签: android google-play-services build.gradle

从android SDK(25)更新到SDK(26)后,面临许多问题。 那么我想升级到最新版本。 目前,可以使用SDK(28),但是我在与Google Play服务地图/位置相关的问题上遇到了麻烦。 我试图分别更改库的版本。

有人可以帮我解决这个问题吗?

此错误发生在与Google Map api相关的代码上。

错误:

  

错误:找不到符号类Place
  错误:包com.google.android.gms.location.places.ui不存在
  错误:包com.google.android.gms.vision.text不存在
  错误:找不到符号类PlaceSelectionListener
  错误:找不到符号类PlaceAutocompleteFragment
  错误:方法未覆盖或从超类型实现方法
  错误:找不到符号类GeoPoint

项目-build.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.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
    }
}
allprojects {
    repositories {
        jcenter()
        maven {url "https://jitpack.io"}
        google()
    }
}

应用-build.gradle

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    signingConfigs {
        debug {
            storeFile file('signature/debug-key.keystore')
        }
        release {
            storeFile file("signature/release-key.keystore")
        }
    }
    defaultConfig {
        applicationId "com.lovelain.getfinedustlevel"
        minSdkVersion 19
        targetSdkVersion 28
        multiDexEnabled true
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt')
            zipAlignEnabled true
            debuggable false
        }
    }
    productFlavors {
    }

    useLibrary('org.apache.http.legacy')

    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }
}

dependencies {
    implementation project(':library')
    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:support-v4:28.0.0'
    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'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

1 个答案:

答案 0 :(得分:1)

已解决,

更新SDK,不仅需要地图/位置api,还需要其他部分。

和相关的Geopoint问题,是修改代码。

以下是应用-build.gradle

dependencies {
implementation project(':library')

implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
}

感谢支持。