1

Tried to add Firebase UI implementation

implementation 'com.firebaseui:firebase-ui-database:6.2.0'

in build.gradle file.

The following error was shown.

*ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.firebaseui:firebase-ui-database:6.2.0.
Affected Modules: app*

Please guide me how to resolve the issue.

I am using Android Studio 3.5.3

Other dependencies I have already implemented in the app

implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'
Manuel Pap
  • 1,309
  • 7
  • 23
  • 52
KAL
  • 41
  • 2
  • 9
  • ERROR Message while implementing FirebaseUI after migrating to AndroidX Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.firebaseui:firebase-ui-database:6.2.0. Could not download auto-value-annotations.jar (com.google.auto.value:auto-value Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.firebaseui:firebase-ui-database:6.2.0. Could not download auto-value-annotations.jar (com.google.auto.value:auto-value-annotations:1.6.5) – KAL Jan 21 '20 at 10:52

3 Answers3

2

You need to update the following dependencies:

implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.4'

to

implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0

Also upgrade to androidX. Check the following for more information:

From the docs:

FirebaseUI version 6.0.0 has no breaking API changes from version 5.1.0 but updates critical dependencies to new major versions.

There are two major groups of changes:

  • Convert all Android Support Library dependencies to AndroidX or Jetpack dependencies. For information on migrating to AndroidX see this guide.
  • Update all Firebase and Google Play services dependencies to their latest major versions. For information on changes included in these SDKs visit the release notes.
Community
  • 1
  • 1
Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
  • When I was doing migrating to AndroidX, it shows _References to be changed_ in build.gradle `implementation 'com.android.support:design:28.0.0`. I dont know what to do now? Please help. – KAL Jan 21 '20 at 11:08
  • you need to change that dependency to androidx, check this https://stackoverflow.com/a/53205831/7015400 refactor and it will change everything for you – Peter Haddad Jan 21 '20 at 11:15
  • Yes, your answer has given me some help. But my issue not resolved yet. Having same error. Don't know what to do now? I am not a professional coder. Just I have learned online. Now trying to use the knowledge what I gained. But facing problem. The intention of implementing firebase UI database is to use FirebaseRecyclerviewAdapter in my app. Any idea how to use it in my app – KAL Jan 21 '20 at 15:12
  • what problem are you getting now? – Peter Haddad Jan 21 '20 at 15:13
  • ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.firebaseui:firebase-ui-database:6.2.0. – KAL Jan 21 '20 at 15:16
  • Did you upgrade to androidx? And update the Firebase dependencies? – Peter Haddad Jan 21 '20 at 17:14
  • Yes, Firebase update also shows Error. Hence retained 16.0.5 – KAL Jan 22 '20 at 01:17
  • I am struggling with [this problem](https://stackoverflow.com/questions/69260024/using-firebaserecycleradapter-causes-dependency-issues), too. – N.Barrett Sep 27 '21 at 19:45
1

You can follow these steps:

  • Press F4 to open Module settings
  • Select Dependency
  • Click Add new dependency
  • Type firebase, search for firebase.ui and add its latest dependency.
Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
0

At last I was able to sync successfully without Error.

The final dependencies in the build.gradle file of the app.

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.firebaseui:firebase-ui-database:6.2.0'
KAL
  • 41
  • 2
  • 9