6

I followed the steps on the Firebase Auth UI page in order to use the Firebase auth drop-in solution in my Android app with the phone number verification provider. I'm using Crashlytics in my project and I'm migrating from Digits to Firebase, so this is the relevant section of the gradle file:

// firebase dependencies
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
compile 'com.firebase:digitsmigrationhelpers:0.1.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'

// crashlytics
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}

// digits (to be removed after migration is complete)
compile('com.digits.sdk.android:digits:2.0.2@aar') {
    transitive = true;
}

And this is how I initialize Fabric:

if (Constants.DEBUG)
    Fabric.with(context, new TwitterCore(authConfig), new Digits.Builder().withTheme(R.style.CustomDigitsTheme).build());
else
    Fabric.with(context, new TwitterCore(authConfig), new Digits.Builder().withTheme(R.style.CustomDigitsTheme).build(), new Crashlytics());

However, I am getting the following error upon gradle synchronization when Constants.DEBUG is true (removing the Digits object in the Fabric init doesn't have any effect on this issue):

Error:Execution failed for task ':app:fabricGenerateResourcesDebug'.
> Crashlytics Developer Tools error.

(Here is the pastebin of the stacktrace)

Removing the Crashlytics dependency solves this issue temporarily. Is there a dependency conflict or is this a bug?

In my project I only have the crashlytics.properties file set with the corresponding keys (not the fabric.properties file). I didn't have an error until this dependency was added to my app's module gradle file.

UPDATE: I previously stated that removing the Crashlytics dependency solved this issue, but it's actually the 'com.firebaseui:firebase-ui-auth:2.0.1' dependency that produces the error when it is included in the gradle file.

UPDATE 2: Thanks to everyone that commented. Researching upon the stacktrace output I found that the more descriptive error is:

java.lang.IllegalArgumentException: Crashlytics found an invalid API key: @string/twitter_consumer_secret.

I will look into this, although it seems very weird to me that this error is triggered specifically by the inclusion of the 'com.firebaseui:firebase-ui-auth:2.0.1' dependency.

dekaru
  • 345
  • 2
  • 10
  • Mike from Fabric here. Can you share your Fabric init? Also, do you have any conditional logic to disable Fabric for some builds? – Mike Bonnell Jun 23 '17 at 15:54
  • I am using Crashlytics, Fabric and Firebase and not getting this issue. May you copy the stacktrace into pastebin? – JP Ventura Jun 23 '17 at 18:11
  • @dekaru Did you set the `crashlytics.properties` and `fabric.properties`? https://stackoverflow.com/questions/28891325 – JP Ventura Jun 23 '17 at 18:13
  • Thanks @MikeBonnell and jp-ventura, I have updated the question to ellaborate on your comments. – dekaru Jun 23 '17 at 21:09
  • Thanks, I think what you're hitting is solved here: https://gist.github.com/cutiko/0cab3fc3b53f339b2274f3667e058dc6 based on this conversation: https://github.com/firebase/FirebaseUI-Android/issues/533 – Mike Bonnell Jun 26 '17 at 18:05
  • Any news on how to fix this @dekaru? I'm having the same issue :/ – Franco Sep 28 '17 at 05:04
  • Hi @Franco. This issue was open for so long that when I tried using firebase-ui again the repo had already been updated and it's working for me now. See my answer for a working gradle configuration. – dekaru Sep 28 '17 at 16:46

1 Answers1

2

The firebase-ui-auth repo has been updated and this is not an issue anymore. The following build.gradle snippet works for me:

// firebase stuff
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.firebase:digitsmigrationhelpers:0.1.1'
compile 'com.google.android.gms:play-services-auth:11.2.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}
dekaru
  • 345
  • 2
  • 10