梯度设置:未找到com.google.android.gms.internal.zzbgl
我读过关于这个问题的类似问答。所有的解决方案都是使用最新的插件。这个问题已经过时,我需要再次使用最新版本的新配置。当我发布这个问题时,我已经检查了插件兼容性,并且所有版本都是最新的,但是还没有成功: 错误:无法访问的zzbgl类文件 找不到com.google.android.gms.internal.zzbgl 项目梯度:梯度设置:未找到com.google.android.gms.internal.zzbgl,android,gradle,Android,Gradle,我读过关于这个问题的类似问答。所有的解决方案都是使用最新的插件。这个问题已经过时,我需要再次使用最新版本的新配置。当我发布这个问题时,我已经检查了插件兼容性,并且所有版本都是最新的,但是还没有成功: 错误:无法访问的zzbgl类文件 找不到com.google.android.gms.internal.zzbgl 项目梯度: buildscript { repositories { google() mavenCentral() jcen
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 14
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
应用程序等级:
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 14
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
我尝试导入以下内容时出错:
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
不要使用组合播放服务目标。它引入了几十个库,使应用程序膨胀。相反,只指定应用程序使用的特定Google Play services API
引用自,您不应使用组合播放服务库。相反,请尝试使用您需要的特定库,并尝试将特定库更新为
15.0.1
您需要从Proguard混淆中排除这些类:
#-dontnote com.google.android.gms.internal.**
-keep,includedescriptorclasses class com.google.android.gms.** { *; }
-keep,includedescriptorclasses class com.google.android.gms.internal.** { *; }
-keep class com.google.android.gms.internal.** {com.google.android.gms.internal.** initialize(android.content.Context);}
我们需要针对您在应用程序中使用的内容进行具体说明,例如,如果您使用的是位置服务,而不是像这样使用它 “实现'com.google.android.gms:play services:17.0.0'” 像这样使用它 “实现'com.google.android.gms:play services位置:17.0.0'”
gradle file(app)您是否尝试使用最新的play services版本?将服务缩小到位置,解决了问题。但是为什么呢?组合包不包括所有库吗?是的,它包括所有库。不知道为什么会出现这个问题,但强烈建议使用特定的库。很好,它解决了你的问题。