如何解决错误:软件包GoogleApiClient不存在

时间:2019-05-22 07:34:02

标签: android

我是一名新的android程序员。我使用android studio,在代码中出现以下错误

error: package com.google.android.gms.common does not exist 
error: package com.google.android.gms.common.api does not exist 
error: package GoogleApiClient does not exist   
error: package GoogleApiClient does not exist   
error: cannot find symbol class GoogleApiClient 
error: package GoogleApiClient does not exist   
error: cannot access ReflectedParcelable
class file for com.google.android.gms.common.internal.ReflectedParcelable not found 
error: method does not override or implement a method from a supertype

我的build.gradile如下

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

    android {
         compileSdkVersion 28
         defaultConfig {
    applicationId "com.example.cityscanner"
    minSdkVersion 23
    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:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// ...
implementation 'com.google.firebase:firebase-core:16.0.9'

// Getting a "Could not find" error? Make sure that you've added
// Google's Maven repository to your root-level build.gradle file
//implementation 'com.google.android.libraries.places:1.1.0'
implementation 'com.google.firebase:firebase-auth:16.2.1'
implementation 'com.google.firebase:firebase-database:16.1.0'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
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.android.support:cardview-v7:28.0.0-rc02'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc02'
 }
  apply plugin: 'com.google.gms.google-services'

在我的代码中,导入语句似乎是错误的

导入com.google.android.gms.common.ConnectionResult; 导入com.google.android.gms.common.api.GoogleApiClient;

这些语句会产生错误

0 个答案:

没有答案
相关问题