java - Android Studio : com. google.android.gms.internal.zzbgl 未找到

标签 java android google-maps android-studio

所以我浏览了许多 stackoverflow 答案,并尝试将它们应用到我的代码中,但我仍然找不到解决此错误的方法。此外,仅当我尝试仅运行该应用程序时,才会发生此错误。我可以毫无问题地构建项目。

这就是我遇到的错误。

error: cannot access zzbgl class file for com.google.android.gms.internal.zzbgl not found

此后我收到此警告

D:\FinalProject\app\src\main\java\com\example\www\mytaxiapp\Welcome.java:
uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.

到目前为止,我尝试更改版本和注释,还添加和删除依赖项,但我仍然无法找到解决方案。希望有人可以帮助我。

这是我的gradle APP级别文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.example.www.mytaxiapp"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.glomadrian:MaterialAnimatedSwitch:1.1@aar'
implementation 'com.firebase:geofire-android:2.1.2'
implementation 'com.github.d-max:spots-dialog:0.7@aar'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
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.google.firebase:firebase-core:16.0.1'
implementation 'com.android.support:design:27.1.0'
//Add Library
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:cardview-v7:26.+'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
}
 apply plugin: 'com.google.gms.google-services'

My Welcome.class 文件导入

package com.example.www.mytaxiapp;

import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.os.Handler;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.animation.Interpolator;
import android.view.animation.LinearInterpolator;
import android.widget.Toast;

import com.firebase.geofire.GeoFire;
import com.firebase.geofire.GeoLocation;
import com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptor;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class Welcome extends FragmentActivity implements OnMapReadyCallback,
    GoogleApiClient.ConnectionCallbacks,
    GoogleApiClient.OnConnectionFailedListener,
    LocationListener
{

最佳答案

更新位置服务为我完成了工作;)

implementation 'com.google.android.gms:play-services-location:15.0.1'

关于java - Android Studio : com. google.android.gms.internal.zzbgl 未找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52222668/

相关文章:

java - 为什么 Spring 4 只允许在一个上下文中使用一个 TaskScheduler?

c# - 与 WCF 通信的 Android 应用程序

java - 在不同的图形环境中查找 JFrame 标题和边框的大小

php - 使用谷歌地图作为背景?

javascript - 如何在 google map api v3 中使用 if 条件检查两个 LatLng 值?

ios - 如何使用 Swift 打开谷歌地图以显示路线

java - 同步一组线程

java - 即使在调用cancel之后,倒数计时器的onTick方法仍然被调用

使用 PackageManager.GET_SIGNATURES 时出现 Android Studio 警告

android - 在Firebase登录上实现Smart Lock密码