【发布时间】:2019-07-15 16:35:13
【问题描述】:
将 Firebase 添加到我的应用后,我因 gradle 问题而生气, 我得到错误: 找不到 com.google.android.gms.internal.zzbgl 的类文件
我使用的是android location和url stringRequest,在那之前它运行良好,然后我将Firebase添加到gradle(我已经在Firebase网站上注册并添加了生成的google-services.json)
我检查了很多没有帮助的答案,我已将 gradle 更新到 3.4.2 仍然无法正常工作
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.mapwithmarker"
minSdkVersion 22
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.google.firebase:firebase-core:17.0.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
//maven {
// url "https://maven.google.com"
//}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
有什么帮助吗?
【问题讨论】:
-
尝试将gradle版本降级到3.2.0。
-
@DheerajRijhwani 这是我更改前的 gradle。同样的错误
标签: android firebase android-gradle-plugin google-play-services