错误:无法访问zzbgl [英] Error: cannot access zzbgl

查看:94
本文介绍了错误:无法访问zzbgl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发应用程序,但出现以下错误:

I am developing an application and I am getting the following error:

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

我知道StackOverflow中存在一个问题,与我4天前发布的错误相同,但是答案对我的情况没有帮助. (我所说的是这一个)

I know there's a question here in StackOverflow with the same error that I'm getting posted 4 days ago but the answer did not help in my case. (I am talking about this one)

在我的项目中设置Firebase Analytics之后,错误就出现了.

The error appeared just right after setting Firebase Analytics in my project.

我的 build.gradle(模块:应用)文件是这样的:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId 'com.geoactio.montferri'
        minSdkVersion 14
        targetSdkVersion 26
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    dependencies {
         implementation 'com.android.support:multidex:1.0.3'
         implementation 'com.android.support:appcompat-v7:26.1.0'
//        compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.0'
        implementation 'com.google.android.gms:play-services:12.0.1'
        //implementation 'com.google.android.gms:play-services-maps:15.0.1'
        //implementation 'com.google.android.gms:play-services-location:15.0.1'
        implementation "com.google.android.gms:play-services-base:15.0.1"
        implementation 'com.navercorp.pulltorefresh:library:3.2.3@aar'

    }
    productFlavors {
    }
    lintOptions {
        disable 'MissingTranslation'
    }

    dexOptions {
        javaMaxHeapSize "4g"
        preDexLibraries = false
    }
}
repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases' }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'

    implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
    transitive = true;
    }
}

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

我的 build.gradle(项目:myPorojectName)文件是这样的:

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

然后点击错误,在 new MarkerOptions()之后紧随此处:

And clicking in the error leads me here, just after new MarkerOptions():

mapView.addMarker(new MarkerOptions().position(new LatLng(puntomarker.getLatitud(), puntomarker.getLongitud()))
                    .zIndex(0.5f)
                    .anchor(0.5f, 0.5f)
                    .title(puntomarker.getId() + "")
                    .snippet(puntomarker.getNombre())
                    .icon(BitmapDescriptorFactory.fromBitmap(((BitmapDrawable) marker).getBitmap())));

(是 mapView 一个 GoogleMap 实例).

我希望有人能看到错误并解决此问题,在此先非常感谢您. 如果您需要更多信息来解决此问题,请告诉我.

I hope someone can see the error and solve this, thank you so much in advance. If you need any more information in order to solve this, please let me know.

推荐答案

Google API版本注释表示对组合的play-services库的支持已于2018年4月终止:

The Google API Release Notes indicate that support for the combined play-services library ended in April 2018:

从15.0.0版本开始,将不再有一个play-services别名目标来引入所有Google Play服务组件.建议将其反对一段时间.

Starting with 15.0.0, there will no longer be a play-services alias target to pull in all Google Play services components. This has been recommended against for some time.

您再也不能像这样对组合的Google Play服务目标指定单个依赖项:

You can no longer specify a single dependency on the combined Google Play services target like this anymore:

implementation 'com.google.android.gms:play-services:12.0.1'.

在以前的版本中支持此功能时,它会将 ALL 引入Google Play库的程度超出了您的需要.请参见设置指南的表1中的API列表,并仅包括特定的您的应用使用的版本.

When this was supported with previous versions, it pulled in ALL the Google Play libs way more than you need. See the list of APIs in Table 1 of the Setup Guide and include only the specific ones your app uses.

检查 Google Maven存储库确认该版本12.0.1是合并的Play-Services目标的最新版本.

A check of the Google Maven Repository confirms that version 12.0.1 was the last version of the combined play-services target.

因此,请删除以上实现并仅使用:

So please delete the above implementation and use only:

implementation "com.google.android.gms:play-services-base:15.0.1"

如果您还使用其他播放服务,请将它们添加为单独的依赖项.

If you are also using other play services, please add them as separate dependencies.

这篇关于错误:无法访问zzbgl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆