This is my productFlavors
definition in build.gradle:
flavorDimensions "fasterbuild", "flavor"
productFlavors {
slow {
dimension "fasterbuild"
// "Slow" uses the defaultConfig minSdkVersion, currently 16
}
fast {
dimension "fasterbuild"
//Use minSdk 21, mainly to avoid legacy multidex
minSdkVersion 21
//Crashlytics will generate a new build id for every build.
//This can (and should) be disabled for debug builds with a single line:
ext.alwaysUpdateBuildId = false
}
dev {
dimension "flavor"
...
}
market {
dimension "flavor"
...
}
}
This produces the following buildVariants:
(I filter out the fastMarket* combinations).
Problem
Based on the above definition, I expect Crashlytics' alwaysUpdateBuildId
setting to be disabled only in fast*
variants.
However, when running assembleSlowDevDebug
, I still see the following:
Detected alwaysUpdateBuildId set to false while obfuscation is enabled. This may result in obfuscated stack traces in Crashlytics.
Here's more of the gradle ouput:
Executing tasks: [:app:assembleSlowDevDebug]
Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/aphex/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/aphex/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
Jack is disabled, but one of the plugins you are using supports Java 8 language features.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
Detected alwaysUpdateBuildId set to false while obfuscation is enabled. This may result in obfuscated stack traces in Crashlytics.
Build cache is an incubating feature.
Using directory (/Users/aphex/.gradle/caches/build-cache-1) as local build cache, push is enabled.
:app:preBuild UP-TO-DATE
:app:preSlowDevDebugBuild UP-TO-DATE
...
I've further confirmed this erroneous behavior by completely removing the ext.alwaysUpdateBuildId = false
line from the fast
variant and re-running assembleSlowDevDebug
. The offending Detected alwaysUpdateBuildId set to false
line disappears.
Question
This doesn't make any sense based on my understanding of build variants and product flavors. Is this a Gradle bug, Crashlytics/Fabric issue, or both? I'm using Gradle 3.5 and the Android tools gradle plugin 2.3.3.
ext.alwaysUpdateBuildId = false
for debug builds, the result is when we build with./gradlew clean assemble
that all of the resulting APKs don't differentiate to crashlytics by package, and if you split packages (like any sensible person would), then crashlytics treats it as if you only have a single package. – Clunk