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

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'

Related

Red-under line error on 'com.android.support:appcompat-v7:28.0.0'

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "com.android.support:support-core-utils:28.0.0"
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.google.code.gson:gson:2.8.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
implementation 'com.firebase:firebase-jobdispagradle -q dependencies your-app-project:dependenciestcher:0.8.5'
implementation 'com.android.support:cardview-v7:28.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.ss.bannerslider:bannerslider:2.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.appbrain:appbrain-sdk:+#aar'
// implementation files('E:/OFFICIAL WORK/Android Projects/EarningStation/libs/mobair-sdk.jar')
implementation 'com.ironsource.sdk:mediationsdk:6.7.12#jar'
implementation 'com.github.mobfox.MobFox-Android-SDK-Core:MobFox-Android-SDK-Core:3.6.2'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.github.mobfox:AndroidVideoCache:v2.7.1'
implementation 'com.github.mobfox.MobFox-Android-SDK-Core:MobFox-Android-SDK-AdMob-Adapter:3.6.2'
}
Red Under-line error on
implementation 'com.android.support:appcompat-v7:28.0.0'
I know this question is asked so many time but i didn't find those are helpful.
I have API level of 28 in android studio and latest sdk-version is 26.0.0-alpha1 in appcompat-v7.
If i make change in the version of 'com.android.support:appcompat-v7:28.0.0' then still the error will be same as now.
I tried all the way that i can, is there any way to solve this problem?
Thanks in advance.
You can use the previous version v7:27.0.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'

FirebaseUI causes DexException Multiple Dex Files

I am using FirebaseUI to try out the RecyclerViewAdapter. When I try to run the app the gradle build doesn't succeed and gives these errors:
Errors shown by Gradle
This doesn't happen when I take out the FirebaseUI Dependency.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'}
Edit: I added MultiDex Support as mentioned on Android Developers Site
What should I do to make the build successful and run the app.
Thanks in advance.

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'

FirebaseUI installation error

I want to use FirebaseUI RecyclerView.
My current app(build.gradle) is as follows:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
My app works fine with this settings, but when I include FirebaseUI, like in the following snippet, my app crashes with an error message: "at com.google.firebase.storage.FirebaseStorage.getInstance(Unknown Source)"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:3.2.1'
testImplementation 'junit:junit:4.12'
implementation 'com.squareup.picasso:picasso:2.71828'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Thank you,
You need to match the firebase version and the firebase-ui version. Use these:
implementation 'com.firebaseui:firebase-ui-database:4.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'

Categories

Resources