I need to use a different set of firebase libraries in the project. But I'm getting the following error :
Unable to resolve dependency for ':#debug/compileClasspath': Could not resolve com.android.support:support-v13:28.0.0.
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-messaging:19.0.0'
// Add dependency
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-iid:19.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
If you want to use the latest versions, then you can use firebase BoM, in the build.gradle, write the following:
dependencies {
// Import the platform
implementation platform('com.google.firebase:firebase-bom:20.0.1')
// When using a BoM, dependencies don't require a specified version
// If you do specify a version, it overrides the library version specified in the BoM
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
}
com.google.firebase:firebase-bom:20.0.1 will contain the latest version of all firebase libraries, then to use each specific library you add them as you normally do but without a version.
References:
https://firebase.google.com/docs/android/setup#firebase-bom
Related
I got this error and I don't know how to fix it.
These are my dependencies in application
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'com.google.firebase:firebase-database-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation platform('com.google.firebase:firebase-bom:28.4.1')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation ('com.google.zxing:core:3.3.3')
implementation 'com.braintreepayments.api:drop-in:3.3.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.loopj.android:android-async-http:1.4.9'
}
Plzz help me to fix this errors?
Edited
I changed minsdk version but it showed another error, also add uses-sdk tools like this error, but got same error.
This problem occur when you are adding two dependencies that includes the same classes.
And I think the accused one should be this braintreepayments dependency, so I recommend updating
implementation 'com.braintreepayments.api:drop-in:3.3.0'
TO a newer version
implementation 'com.braintreepayments.api:drop-in:5.2.2'
And for sure you have already added the mven repo to your project gradle file.
repositories {
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree_team_sdk'
password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
}
}
}
For more, check this:
https://github.com/braintree/braintree-android-drop-in
EDITED
Don't forget to set the min sdk version 21 or above
defaultConfig {
...
minSdkVersion 21
...
}
and remove this line if exists in the manifest
<uses-sdk android:minSdkVersion="16"/>
I have following firebase libraries:
implementation platform('com.google.firebase:firebase-bom:26.8.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-perf'
after I upgrade them to 27.0.0
implementation platform('com.google.firebase:firebase-bom:27.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-inappmessaging-display'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-perf'
This library disapper:
com.google.androind.gsm:play-services-base:17.0.0#aar
Which brakes following import:
import com.google.android.gms.common.GoogleApiAvailability
Any idea how to fix this properly?
I solved it by adding manually this version:
implementation 'com.google.android.gms:play-services-base:17.3.0'
I hope it is correct version, because 'com.google.android.gms:play-services-basement' was also 17.3.0 which has dependecy from 'com.google.firebase:firebase-bom'.
But this solution is not nice, because I have to check if I use correct version after each BOM update, which makes BOM idea (use all compatible libraries by itself) pretty useless.
It is also strange, that last available version is com.google.android.gms:play-services-base:17.6.0.
After upgrading Microsoft Graph dependency in my project from implementation 'com.microsoft.graph:microsoft-graph:2.10.0' to implementation 'com.microsoft.graph:microsoft-graph:3.0.0' the compilation fails with following error:
Duplicate class javax.activation.ActivationDataFlavor found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
Duplicate class javax.activation.CommandInfo found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
...
Duplicate class javax.activation.UnsupportedDataTypeException found in modules jetified-activation-1.1 (javax.activation:activation:1.1) and jetified-jakarta.activation-api-1.2.1 (jakarta.activation:jakarta.activation-api:1.2.1)
Have any of you seen this before, and how do I fix this behaviour ?
Anyone knows if the changes in v3.0.0 are so severe that they can`t coexist with this dependency scheme ?
dependencies {
implementation platform('com.google.firebase:firebase-bom:26.1.0')
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-perf-ktx'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
implementation 'androidx.core:core-ktx:1.5.0-beta03'
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.camera:camera-camera2:1.1.0-alpha02'
implementation 'androidx.camera:camera-lifecycle:1.1.0-alpha02'
implementation 'androidx.camera:camera-view:1.0.0-alpha22'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-beta01'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'
implementation 'androidx.fragment:fragment-ktx:1.3.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.room:room-runtime:2.3.0-beta03'
kapt 'androidx.room:room-compiler:2.3.0-beta03'
implementation 'androidx.room:room-testing:2.3.0-beta03'
implementation 'androidx.room:room-ktx:2.3.0-beta03'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.2.0-beta02'
implementation ('com.microsoft.identity.client:msal:2.0.8')
{exclude group: 'com.microsoft.device.display'}
implementation ('com.microsoft.graph:microsoft-graph:3.0.0')
implementation 'com.google.android.material:material:1.4.0-alpha01'
//Guava, to avoid conflict on ListenableFuture on jetified-guava-20.0 (com.google.guava:guava:20.0)
// and jetified-listenablefuture-1.0 (com.google.guava.listenablefuture:1.0)
// https://stackoverflow.com/questions/56639529/duplicate-class-com-google-common-util-concurrent-listenablefuture-found-in-modu
implementation 'com.google.guava:guava:30.1-jre'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.maps.android:android-maps-utils:2.2.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
}
Actually this version change is breaking, and here is the migration guide:
https://www.github.com/microsoftgraph/msgraph-sdk-java/tree/dev/docs%2Fupgrade-to-v3.md
But you might also add some exclusions in your packaging option in build.gradle (:app) like:
packagingOptions{
exclude("META-INF/INDEX.LIST")
exclude("META-INF/AL2.0")
exclude("META-INF/LGPL2.1")
exclude("META-INF/LICENSE.md")
exclude("META-INF/NOTICE.md")
exclude("META-INF/io.netty.versions.properties")
}
You might need add some more...
I am trying to begin with FirestorePagingAdapter and FirestorePagingOptions
and I read the documentation carefully like here
https://github.com/firebase/FirebaseUI-Android/tree/master/firestore
and applied it by step by step
1-
implementation 'android.arch.paging:runtime:1.x.x'
2- Query baseQuery = mItemsCollection.orderBy("value", Query.Direction.ASCENDING);
But when I am trying to add FirestorePagingOptionsit appears by the red line code that means it is not imported or implemented well and I am not using any android architecture models. After a lot of searches, I found nothing clear about it
So what is the right way to begin with FirestorePagingAdapter ? what I should implement to begin with?
this is my implementation
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:16.0.3'
//google sign inj
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.google.firebase:firebase-firestore:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-storage:15.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
//FIREBASE UI LIBRARY
implementation 'android.arch.lifecycle:runtime:1.1.1'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.paging:runtime:1.0.1'
implementation 'android.arch.core:runtime:1.1.1'
implementation 'android.arch.core:common:1.1.1'
implementation 'android.arch.lifecycle:common-java8:1.1.1'
May be it's too late to answer. I reached to this page as I faced exactly the same issue.
Adding implementation 'com.firebaseui:firebase-ui-firestore:4.3.2' to the gradle dependencies solved this issue.
I had an Android project with gradle 2.2.0 and android-apt plugin 1.8. I had time to update it to newer tools gradle 3.1.0 and remove apt plugin to use newer proposed solution with implementation/CompileOnly and annotation processor keywords. After that project build/compile correctly and apk file is pushed to device but when I open class that uses: butterknife, tourguide, FancyToast or material-dialogs libraries class not see this dependencies (imports & references are marked in red).
Did anyone had the same issue?
Current dependencies:
dependencies {
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
annotationProcessor "org.projectlombok:lombok:1.16.12"
compileOnly "org.projectlombok:lombok:1.16.12"
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation ('com.github.worker8:tourguide:1.0.14-SNAPSHOT#aar') {
transitive = true;
}
implementation files('libs/greendao-2.1.0.jar')
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//dagger
compileOnly 'javax.annotation:jsr250-api:1.0'
implementation 'com.google.dagger:dagger:2.0.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
}
//save player objects (protect from removing it)
implementation 'com.google.code.gson:gson:2.7'
//permutation library
implementation 'com.googlecode.combinatoricslib:combinatoricslib:2.1'
//new toasts
implementation 'com.github.Shashank02051997:FancyToast-Android:0.1.3'
//tests
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:2.+"}
Project compiles/works but it is obstacle to work with this libraries
If your dependencies declared in different module you should use api instead of implementation
eg:
api 'com.google.dagger:dagger:2.0.2'