An App Engine project in Android Studio is (by default) configured to generate a client library, which can be consumed by an Android and/or iOS app.
Gradle is configured to auto-generate the library:
apply plugin: 'appengine'
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
Note there is no version specified anywhere here.
As specified in https://cloud.google.com/appengine/docs/java/endpoints/gen_clients, the library name is generated as
/target/<yourProjectVersion>.<versionString>-rc-SNAPSHOT.jar
This documentation is probably still from the rc candidate of Android Studio, as my library looks like this:
com.mydomain:api:v2-1.20.0-SNAPSHOT
I am using that library in a separate project:
compile 'com.mydomain:api:v2-1.20.0-SNAPSHOT'
This works fine, until Android Studio or gradle or Google or whoever changes the version number, here 1.20.0
. Then my app compile breaks until I adjust the version in gradle.
- Why is that? Can anybody tell me why the version stays stable for months and then suddenly changes from one day to another without any update or changes performed from my side. What is that version, who generates it, and can I control it when I generate it from my App Engine project?
NB: Given that the App Engine module and the Android app module are in the same project, Android Studio changes both versions and everything is fine. But when projects are separate, automated builds break.