- Remote dependency merge rule
If multiple modules depend on the library in the way of [implementation + coordinates], only one version will be compiled, and it is the latest version
module A:
implementation "com.fengma.tool:gradle-tool:2.1.2"
...
module B:
implementation "com.fengma.tool:grdle-tool:2.3.3" //gradle default the latest version
If you want to change the default compile version selection, you can specify a version by using gradle’s dependency selection mechanism
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.fengma.tool') {
details.useVersion '2.1.2'
details.because 'Use Lower version'
}
}
}
2. Local plus remote dependency mode
When module a introduces a jar package in the way of [local lib], and module B introduces the same library in the way of [implementation + coordinates], it will cause compilation conflicts and lead to compilation failure. Therefore, it is necessary to unify the dependency mode.
module A:
compile files('libs/fengma-tool-2.1.2-.jar')
...
module B:
compile "com.fengma.tool:grdle-tool:2.3.3"
... Compilation conflicts, class duplication
Read More:
- Error: You have not concluded your merge (MERGE_HEAD exists)
- Android dependency conflict resolution
- Viewing Android dependency tree using gradle
- Android Cannot merge new index 67208 into a non-jumbo instruction
- You have not concluded your merge (MERGE_HEAD exists)
- C++: terminate called after throwing an instance of ‘std::length_error‘ (sort function cmp sorting rules problem)
- Error: Error parsing D:\new_android\Android SDK\system-images\android-25\android-wear\armeabi-v7a\de
- Please specify which branch you want to merge with
- Android Studio | Failed to find target with hash string ‘android-26’ in: D:\Android\sdk
- 21. Merge Two Sorted Lists [easy] (Python)
- Git solves pull origin error: the following untracked working tree files would be rewritten by merge
- fatal: refusing to merge unrelated histories
- Fatal: reusing to merge unrelated histories
- Mac Windows partition merge and delete
- error: Your local changes to the following files would be overwritten by merge
- Error: your local changes to the following files would be rewritten by merge solution
- [FAQ] after git merge, the push to Gerrit fails, indicating no new changes?
- Unable to resolve dependency tree
- LeetCode 23. Merge k Sorted Lists(java)
- Resolving fatal: reusing to merge unrelated histories in Git