I have a multi-taste project that is built by CI and published on HockeyApp. Each taste has applicationId and apiToken , which is stored in the flavor itself (in order to save all the important variables in one place):
def token = null
productFlavors {
prod {
applicationId "de.example.appname"
buildConfigField 'String', 'FLAVOR_ID', '"0"'
buildConfigField 'String', 'HOCKEY_APP_ID', '"1234567890"'
token = "1q2w3e4r5t6z7u8i9o0p"
}
demo {
applicationId "de.example.appname.demo"
buildConfigField 'String', 'FLAVOR_ID', '"1"'
buildConfigField 'String', 'HOCKEY_APP_ID', '"987654321"'
token = "p0o9i8u7z6t5r4e3w2q1"
}
}
At the same level as "productFlavors", there are hockeyApp settings:
hockeyapp {
apiToken = token
releaseType = 0
notify = 0
status = 1
notesType = 1
notes = "Uploaded with gradle"
}
To debug the code, I create and upload the .apk file through the terminal:
./gradlew uploadProdReleaseToHockeyApp [...]
Unfortunately, the prod product token is always overridden by the demo value. Therefore, after each boot process, I get errors, for example
HockeyApp response error: application could not be created.
because gradle is trying to load the prod daemon with a demo token.
:
compileSdkVersion 24
buildToolsVersion "24.0.1"
compile 'net.hockeyapp.android:HockeySDK:4.0.0'
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'de.felixschulze.gradle:gradle-hockeyapp-plugin:3.5'
, ?