Java FireBase错误:无法访问com.google.android.gms.internal.zzanb的zzanb类文件找不到
UPD。我已经阅读了这些问题和答案()。但我不明白我需要在项目中添加或删除哪些字符串。 因为我的代码中没有此字符串和其他字符串: 编译'com.google.android.gms:play services位置:9.2.0' 我使用FireBase开发了一个android应用程序。当我想要构建我的项目时,我有一个错误: 错误:(39,25)错误:无法访问zzanb 找不到com.google.android.gms.internal.zzanb的类文件 该错误是由调用语句引起的:FirebaseAuth.getInstance().getCurrentUser()强> Projects build.gradle:Java FireBase错误:无法访问com.google.android.gms.internal.zzanb的zzanb类文件找不到,java,android,firebase,Java,Android,Firebase,UPD。我已经阅读了这些问题和答案()。但我不明白我需要在项目中添加或删除哪些字符串。 因为我的代码中没有此字符串和其他字符串: 编译'com.google.android.gms:play services位置:9.2.0' 我使用FireBase开发了一个android应用程序。当我想要构建我的项目时,我有一个错误: 错误:(39,25)错误:无法访问zzanb 找不到com.google.android.gms.internal.zzanb的类文件 该错误是由调用语句引起的:Firebas
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "xxx.yyy.zzz"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
apply plugin: 'com.google.gms.google-services'
模块build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "xxx.yyy.zzz"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.0'
compile 'com.firebaseui:firebase-ui:0.6.0'
compile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
apply plugin: 'com.google.gms.google-services'
请帮我解决这个错误)
另外,我已经读过这个问题(),但我什么都不懂,在我的情况下,我需要从build.gradle文件中添加或删除什么。您正在混合新旧Firebase发布的库。从Firebase到您使用的一切都应该是对等的。这一行引用了一个非常古老的Firebase版本的库(在它成为Google的Firebase平台之前): 如果要使用Firebase UI库,应使用与正在使用的主客户端库版本匹配的。您使用的是10.0.1,因此根据我刚才链接的Firebase UI github上的表,您需要此依赖项:
compile 'com.firebaseui:firebase-ui:1.1.1'
始终确保您的Firebase UI库与您正在使用的核心Firebase SDK相匹配。您正在混合使用新旧Firebase发布的库。从Firebase到您使用的一切都应该是对等的。这一行引用了一个非常古老的Firebase版本的库(在它成为Google的Firebase平台之前): 如果要使用Firebase UI库,应使用与正在使用的主客户端库版本匹配的。您使用的是10.0.1,因此根据我刚才链接的Firebase UI github上的表,您需要此依赖项:
compile 'com.firebaseui:firebase-ui:1.1.1'
始终确保您的Firebase UI库与您正在使用的核心Firebase SDK匹配。在您的案例中,修复程序似乎解决了您的问题,但我们最近遇到了相同的问题,其根本原因不同 在我们的例子中,我们已将IDE项目配置为使用JDK8,但未能检查终端中使用的是哪个版本的JDK。因为React Native在您键入“React Native run android”时从命令行运行Gradle,Gradle试图使用JDK10进行构建,这导致了明显的问题,因为android目前最多只支持JDK8。一旦我们将终端配置为使用JDK8,问题就解决了
TL;DR:检查您在终端中使用的JDK版本。在您的案例中,修复程序似乎解决了您的问题,但我们最近遇到了相同的问题,但根源不同
Getting following error:
error: cannot access zza
class file for com.google.android.gms.common.internal.safeparcel.zza not found
dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
/* implementation 'com.google.firebase:firebase-core:9.2.0' // this line must be included to integrate with Firebase
implementation 'com.google.firebase:firebase-messaging:10.2.1' // this line must be included to use FCM*/
//implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.google.android.gms:play-services-maps:10.2.1'
implementation 'com.google.firebase:firebase-core:10.2.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
}
在我们的例子中,我们已将IDE项目配置为使用JDK8,但未能检查终端中使用的是哪个版本的JDK。因为React Native在您键入“React Native run android”时从命令行运行Gradle,Gradle试图使用JDK10进行构建,这导致了明显的问题,因为android目前最多只支持JDK8。一旦我们将终端配置为使用JDK8,问题就解决了
TL;DR:检查您在终端中使用的JDK版本。可能与@Danieboy重复我已经更新了我的问题。请参阅itAlways参考官方文档来编译Firebase或您找到的任何库。然后继续学习教程告诉您使用的
firebase ui:0.6.0
可能重复的@Danieboy我已经更新了我的问题。请参阅itAlways参考官方文档来编译Firebase或您找到的任何库。然后继续使用教程告诉您使用的firebase ui:0.6.0
链接是纯金的链接是纯金的
Getting following error:
error: cannot access zza
class file for com.google.android.gms.common.internal.safeparcel.zza not found
dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-analytics:17.0.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
/* implementation 'com.google.firebase:firebase-core:9.2.0' // this line must be included to integrate with Firebase
implementation 'com.google.firebase:firebase-messaging:10.2.1' // this line must be included to use FCM*/
//implementation 'com.google.android.gms:play-services:10.2.1'
implementation 'com.google.android.gms:play-services-maps:10.2.1'
implementation 'com.google.firebase:firebase-core:10.2.1'
implementation 'com.google.firebase:firebase-messaging:10.2.1'
}