Skip to content

Instantly share code, notes, and snippets.

@cutiko cutiko/AndroidManifest.xml
Last active Mar 23, 2018

What would you like to do?
Firebase Twitter login and Fabric crash solution guid

Fix Fabric and Twitter login Firebase-ui-auth

  1. Create an application class, is a simple class wich extend the class application
  2. Inside your application class, put the solution provided. Since we are on it, we can also enable offline persistence for Firebase database
  3. Register your class in the AndroidManifest.xml
  4. Please be aware that there are 2 problems solved there, conflict with RTL and the original crash with Twitter login
  5. Fix the graddle, if by any chance you the 'maven { url '' }' in the general project graddle, remove it from there. Fabric allready added to your app graddle.
  6. Remember to use the latest Firebase-ui-auth version, there is a Twitter conflict with reusable email solved alrready.
<!--You can see here, that there are 2 attributes added. First tools:replace="android:supportsRtl" is ment to fix the rtl merge conflict
and android:name=".YourApp" is ment to register the class extending application as your app-->
public class YourApp extends Application {
public void onCreate() {
TwitterAuthConfig authConfig = new TwitterAuthConfig(getString(R.string.twitter_consumer_key), getString(R.string.twitter_consumer_secret));
Fabric.with(this, new Twitter(authConfig), new Crashlytics());
//You will probably be using the Firebase RealTime Database, and since we are creating this application class,
//go a head and uncomment below line to activate offline feature

This comment has been minimized.

Copy link

Andrewwallace59 commented Mar 23, 2018

Hey, Thanks for posting this it helped me resolve the issue I was having. Thought I would pitch this in as well in case anyone needs the debug option too:

    final Fabric fabric = new Fabric.Builder(this)
            .kits(new Twitter(authConfig), new Crashlytics())
            .debuggable(true)           // Enables Crashlytics debugger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.