Android Studio 3.0 Firebase

↘锁芯ラ 提交于 2019-12-13 07:34:37

问题


I have been using firebase authentication without any problem with compile SDK version 26.01 of Android Studio 2.3.3 until yesterday.

However, since I updated to 3.0 yesterday, every time I sign-in, Developer error Toast will appear and my app will be terminated abnormally.

Now I have erased and installed Android studio several times because of this problem.

providers.add(new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());

        startActivityForResult(
                AuthUI.getInstance()
                        .createSignInIntentBuilder()
                        .setIsSmartLockEnabled(false)
                        .setIsSmartLockEnabled(!BuildConfig.DEBUG)
                        .setLogo(R.drawable.logo_layer)
                        .setProviders(providers)
                        .setTheme(R.style.GreenTheme)
                        .build(),
                RC_SIGN_IN);

and the error messages here.

I/zygote: Rejecting re-init on previously-failed class java.lang.Class<com.firebase.ui.auth.provider.TwitterProvider>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/twitter/sdk/android/core/Callback;


I/zygote: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.twitter.sdk.android.core.Callback" on path: 

These codes really worked perfectly well from version 2.3.3 until yesterday. Now, however, these error messages appear and do not work at all. Even I have used only the google provider in the Auth UI. I did not use Twitter-Provider at all. but suddenly comes like this... I do not know why at all.

And an emulator has been changed also just like below. And I think this also seems to have a significant impact on the problem, in Firebase Authentication.


回答1:


I was getting the same error, and like you, I am not specifying Twitter as one of the available sign-in providers.

I was able to eliminate the error by adding the Twitter SDK library to the app dependencies:

implementation ("com.twitter.sdk.android:twitter-core:3.0.0@aar") {
    transitive = true
}



回答2:


Try adding the following repository to your build.gradle:

allprojects {
repositories {
    // ...
    maven { url 'https://maven.fabric.io/public' }
 }
}


来源:https://stackoverflow.com/questions/46986143/android-studio-3-0-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!