java - Android 工作室:com.google.android.gms.internal.zzbgl 未找到
问题描述
所以我经历了很多 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'
我的 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'
推荐阅读
- c# - 在同一个端口上发布两个具有两个不同证书的 gRPC 服务
- php - laravel 的生产模式和开发模式有什么区别?
- node.js - 使用 Admin Firebase 使用电子邮件和电话提供商创建用户
- java - 实现 cli 应用程序的适当方法,该应用程序还使用 Micronaut 的服务配置文件
- python - 使用常用列值作为数据框的索引设置索引
- database - 为什么 react-native 应用程序不能像 MongoDB 一样使用远程存储?
- db2 - 如何在sql/pl中做一个子过程
- react-native - 如果字符串为空,如何在反应导航中设置默认标题?
- reactjs - 我将如何为来自操作的 JSON 数据定义我的接口?
- php - 从 html 切换到 php 时消失的元素和奇怪的行为