I've marked my dependencies to be 24.2.1 in app/build gradle file, but when i run " gradlw app:dependencies" it shows 25.1.0 as resolved.not sure how this happening as i haven't add any dependency with 25.1.0 ?is there any way i can find which library pulling the latest
gradlw app:dependencies
-- com.android.support:appcompat-v7:24.2.1 -> 25.1.0
+--- com.android.support:support-annotations:25.1.0
+--- com.android.support:support-v4:25.1.0
In Android Studio
When this happen it's because another library you are using is pulling in other versions of the same dependencies.
You need to figure out your dependency tree with the command
./gradlew app:dependencies
to execute in the Android Studio terminal.
Then you need to scroll up the terminal window until you find the dependencies tree, check for some nested dependency coming from thirdy party libraries like in the example image below.
When you have found a version conflict between the third party dependency and the same dependency you declared in your buid.gradle you can exclude the pulled library and force the library to use your version:
For your problem with the support-library, you could proceed in this way:
compile ("com.example.libwithconfictdependency:library:1.0.0") {
//this to exclude specific modules
exclude group: 'com.android.support', module: 'support-v4'
//or this to exclude every modules of the same package
exclude group: 'com.android.support'
}
The problems in this case are:
- The library could not work because the dependency you overrided manually are not compatible with the library code
- You need to provide all the necessary dependencies in your build.gradle
That's up to you decide how to proceed about this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With