Android studio : com.google.android.gms.internal.zzbgl not f



所以我经历了许多堆栈溢出答案,我尝试将它们应用于我的代码,但我仍然找不到此错误的修复程序。此外,仅当我尝试仅运行应用程序时,才会发生此错误。我可以毫无问题地构建项目。

所以这是我得到的错误。

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

同样在那之后,我收到这个作为警告

D:FinalProjectappsrcmainjavacomexamplewwwmytaxiappWelcome.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'

我的欢迎.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'

Google GMS是一个非常大的依赖关系。您可以尝试启用 multidex(通过在默认配置中添加以下行:

defaultConfig {    
...
multiDexEnabled true
...
}

如果您的目标是较低的Android版本,则需要包含support-Multidex作为依赖项:

implementation 'com.android.support:multidex:1.0.3'

在这种情况下,您应该添加一个应用程序类,同时覆盖 attachBaseContext,如下所示:

@Override
protected void attachBaseContext(Context base) {
MultiDex.install(this);
super.attachBaseContext(base);
}

请不要忘记清晰的项目和gradle-sync。

希望有帮助。

相关内容

  • 没有找到相关文章