问题
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