In my gradle file I have this
dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
...
}
But then, running gradle dependencies
I see something like this
+--- com.android.support:appcompat-v7:23.0.0 -> 23.1.1
| \--- com.android.support:support-v4:23.1.1
What may indicates that it is automatically using 23.1.1
. This causes problems with libraries depending on 23.0.0
. I get errors like this
error: cannot find symbol variable dialog_fixed_height_major
error: cannot find symbol variable dialog_fixed_height_minor
error: cannot find symbol variable dialog_fixed_width_major
error: cannot find symbol variable dialog_fixed_width_minor
error: cannot find symbol variable RtlOverlay_Widget_AppCompat_ActionButton_Overflow
This is because those symbols were removed on version 23.1.0
How can I force gradle to build agains 23.0.0
so I make dependencies happy?
The "problem" is Gradles conflict resolution strategy. Some dependency you have depends on the newer version of the library. If you scroll down in the output of dependencies
, then you see which one.
The default resolution strategy of Gradle is to take the newest requested version. You can change it to fail the build instead which means you have to resolve all version conflicts manually. But if you have stuff that depends on the newer version, the question is whether it can work with the older version.
You can read more about conflict resolution in the Gradle User Guide.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments