Gradle build errors in Firebase UI dependency - android

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:exifinterface:28.0.0-alpha3'
implementation 'com.android.support:support-media-compat:28.0.0-alpha3'
implementation 'com.android.support:support-v4:28.0.0-alpha3'
implementation 'com.android.support:design:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-vector-drawable:28.0.0-alpha3'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
}
These are my dependencies but it is giving me gradle errors, its because of the FirebaseUI dependency as when I delete that the app builds fine.
Can anyone help me how to resolve this? I know its most probably some version issue.

According to the docs:
As of version 4.1.0, FirebaseUI has the following dependency versions:
Library Version
firebase-auth 16.0.1
play-services-auth 15.0.1
firebase-database 16.0.1
firebase-firestore 17.0.1
firebase-storage 16.0.1
Update the following to dependencies:
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
to this:
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-storage:16.0.1'
Also add:
implementation 'com.google.firebase:firebase-core:16.0.1'
Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.
In the top level gradle file use the following google-service plugin:
classpath 'com.google.gms:google-services:4.0.2'

If FirestoreRecyclerAdapter is showing an error means.....
just add these dependencies
implementation 'com.firebaseui:firebase-ui-firestore:8.0.1'
implementation 'com.google.firebase:firebase-core:19.0.2'
This will work fine

Related

Failed in linking file

Dependency is appcompat dependency is underlined red and failed to build project fully
Changed all support libraries to use the compiledsdk version but still didnt work
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:28.1.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'com.onesignal:OneSignal:3.10.7#aar'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.ixiDev:GDPRChecker:v0.2'
implementation 'com.github.siyamed:android-shape-imageview:0.9.3#aar'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.github.arcadefire:nice-spinner:1.4.3'
implementation 'com.github.mjn1369:prettydialog:1.0.4'
implementation project(path: ':SmoothCheckBox-master')
implementation project(':androidsaripaarmaster')
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation project(':rating-view')
implementation project(':pinlockview')
That is the error message that shows:
Compilation failed to complete
Problem is in this dependency com.google.android.gms:play-services-location:17.0.0. This location dependency use androidX Libraries.
Solution is: Either downgrade this dependency version or migrate to Androidx (whole project dependencies)

Gradle Sync Fails - "com.google.android.gms:play-services-base"

Came across this issue while implementing firebase dependencies along with google play location dependencies:
ERROR: The library com.google.android.gms:play-services-base is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies.
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.1.0'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
}
Any suggestions on how to resolve this...

Firebase conflicts my gradle *Mixing versions can lead to runtime crashes"

At least I believe firebase is the problem since it only happens when I add admob to the the mix
if I dont add this line implementation 'com.google.firebase:firebase-ads:17.0.0' everything is ok. trying to find a way to find older versions of this library to maybe resolve my error but to no luck
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
Those warnings can be solved by adding the following lines of code in your build.gradle file:
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
Use implementation 'com.google.firebase:firebase-ads:17.1.1'

Cannot resolve symbol 'OnSuccessListener' in Android Studio

I'm getting this strange behavior that I'm not able to import OnSuccessListener to my code after git cloning and building in a different machine (this resolved fine in my previous machine). However the project builds fine and runs on the emulator. But I'm not able to write firebase related codes further as the listener isn't resolving.
I tried cleaning the project, rebuilding, invalidating the cache but still no luck.
Gradle Dependencies,
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-firestore:17.0.4'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.android.support:design:27.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.github.drawers:SpinnerDatePicker:1.0.6'
implementation 'com.github.yalantis:ucrop:2.2.2'
}
Please try adding this into your app-gradle file.
implementation 'com.google.android.gms:play-services-tasks:16.0.1'
What you do is make all the firebase and gms version of the same number like for example:
implementation 'com.google.firebase:firebase-auth:102.0'
implementation 'com.google.android.gms:play-services-auth:10.2.0'

Update Google Service Plugins and Unable to Install App After gradle built Successfully

I am working on Android app that uses the Firebase Database for the Storage of Data but the problem comes when app doesn't Install after the Successful built.
Here is the Image of Error in the Gradle
Here is the code of Build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
}
Update the firebase libraries to the following:
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
and in the top level gradle file use:
classpath 'com.google.gms:google-services:4.0.2'
Try this please, replace 27.1.1 with 26.1.0
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:gridlayout-v7:26.1.0'

Categories

Resources