Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
It does not occurred when remove
implementation 'com.google.firebase:firebase-firestore:21.3.0'
dependency in my gradle and It causes only when to test not to run app
.
here is the full error message
Cannot find a version of 'com.google.code.gson:gson' that satisfies the version constraints:
Dependency path 'myapp:app:unspecified' --> 'androidx.room:room-testing:2.2.1' --> 'androidx.room:room-migration:2.2.1' --> 'com.google.code.gson:gson:2.8.0'
Constraint path 'myapp:app:unspecified' --> 'com.google.code.gson:gson:{strictly 2.7}' because of the following reason: debugRuntimeClasspath uses version 2.7
Dependency path 'myapp:app:unspecified' --> 'com.google.firebase:firebase-firestore:21.3.0' --> 'io.grpc:grpc-android:1.21.0' --> 'io.grpc:grpc-core:1.21.0' --> 'com.google.code.gson:gson:2.7'
What should I do?
First of all, you can always check your dependencies tree like this: gradlew app:dependencies (that's assuming your module in question is called app; for linux you will likely have to call it like this ./gradlew app:dependencies)
That said, your log seems to contain all you need already: room is using 2.8.0 and firebase is using 2.7. Please try to exclude gson transitive dependency, say, from room (exclude group: 'com.google.code.gson') and let's see if that helps.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.