The hard way to do this is not in my understanding. Tons of people use library projects that they donβt own, must build with Jenkins or have other reasons not to touch them and donβt want to shell them out for personal use.
Anyway, I found a solution here .
Copy it here just in case:
You have root build.gradle add
ext { compileSdkVersion = 20 buildToolsVersion = "20.0.0" } subprojects { subproject -> afterEvaluate{ if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) { android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion } } } }
This will apply compileSdkVersion and buildToolsVersion to any of your Android modules.
And in your main build.gradle project, the dependencies on this change:
compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion
You basically define them once and can use them from anywhere.
Greetings.
Ver
source share