2017-01-24 32 views
3

UPD。我已閱讀這些問題和解答(Class file for com.google.android.gms.internal.zzaja not found)。但我不明白我需要在我的項目中添加或刪除哪些字符串。 因爲我還沒有這一點,在我的代碼其它串: 編譯「com.google.android.gms:發揮服務定位:9.2.0」FireBase錯誤:無法訪問com.google.android.gms.internal.zzanb找不到zzanb類文件

我開發與利用火力的Android應用程序。而當我想建項目中,我有一個錯誤:

錯誤:(39,25)錯誤:無法訪問com.google.android.gms.internal.zzanb zzanb 類文件未找到

該錯誤是由調用語句引起的:FirebaseAuth.getInstance()。getCurrentUser();

項目的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 
} 

模塊的build.gradle:

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' 

請幫我解決這個錯誤)

PS我已經看過了這個問題( Firebase Error cannot access zzanb after using play-services-xxx:9.8.00),但我不明白什麼,我需要添加或從我的build.gradle文件中刪除我的情況。

+0

[找不到com.google.android.gms.internal.zzaja的類文件]的可能重複(http://stackoverflow.com/questions/38073706/class-file-for-com-google-android-gms -internal-zzaja-未找到) – Danieboy

+0

@Danieboy我已更新我的問題。請參閱 –

+0

請務必參考官方文檔來編譯Firebase或您找到的任何庫。 **然後**去繼續任何教程告訴你使用'firebase-ui:0.6.0' –

回答

2

您正在混合舊版和新版Firebase發佈的庫。您使用的所有Firebase應該是平等的。這條線是參考從一個非常古老的火力地堡版本的庫(之前它成爲了谷歌的火力地堡平臺):

compile 'com.firebaseui:firebase-ui:0.6.0' 

如果你想使用火力地堡-UI庫,你應該使用的版本匹配the new version of it您正在使用的主要客戶端庫。您使用10.0.1,那麼根據上我只是掛了火力地堡的UI github上的表,你想這種依賴性:

compile 'com.firebaseui:firebase-ui:1.1.1' 

務必確保您的火力地堡的UI庫中的核心火力地堡SDK你」匹配重新使用。

+0

該鏈接是純金 –

相關問題