如何解决错误:找不到com.google.android.gms.internal.zzbej的zzbej类文件

时间:2019-06-11 14:16:24

标签: java android android-studio

在我的android应用中,我试图获取用户的位置,由于构建失败,我无法在模拟器上运行我的应用

我尝试过 清理项目-重建项目-与Gradle文件同步项目-与文件系统同步-使缓存无效

  private LocationRequest mLocationRequest;

  private void createLocationRequest() {
        mLocationRequest = new LocationRequest();
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        mLocationRequest.setInterval(UPDATE_INTERVAL);
        mLocationRequest.setFastestInterval(FATEST_INTERVAL);
        mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
    }

错误是:

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

成绩(应用级别):

   implementation 'com.google.android.gms:play-services-places:11.6.2'
   implementation 'com.google.android.gms:play-services:11.6.2'
   implementation 'com.google.android.gms:play-services-location:11.6.2'
   implementation 'com.google.android.gms:play-services-maps:11.6.2' 
   implementation 'com.google.android.gms:play-services-base:16.1.0'
   implementation 'com.google.android.gms:play-services-analytics:16.0.8'
   implementation 'com.google.firebase:firebase-database:16.1.0'
   implementation 'com.google.firebase:firebase-auth:16.2.1'
   implementation 'com.google.firebase:firebase-core:16.0.8'
   implementation 'com.google.firebase:firebase-database:16.1.0'

等级(项目级别):

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.android.tools.build:gradle:3.2.1'
    }

}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com'
            maven { url "https://jitpack.io" }

            configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
                config.resolutionStrategy.eachDependency { details ->
                    details.useVersion("3.5.0-alpha03-5252756")
                }
            }
        }

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

一切都应该没问题,但是无论发生什么错误,错误总是在createLocationRequest的第二行发生。

0 个答案:

没有答案