I have two product flavors, and set the testApplicationId like so in build.gradle:
defaultConfig {
    minSdkVersion 8
    targetSdkVersion 19
    testApplicationId 'com.example.testapp'
}
Is it possible to override this testApplicationId in each productFlavor?
I tried overriding the testApplicationId itself in the individual productFlavors, but then the R.class file doesn't get generated, and I get a compile error.
I read about the packageName/applicationId not affecting the R.class file, but I'm not sure if that rule holds for the testApplicationId too.
I verify this works as expected in Android Gradle Plugin version 2.3.0
defaultConfig {
    ...   
    testApplicationId 'default'
}
productFlavors {
    first {
        testApplicationId 'first'
    }
    second {
        testApplicationId 'second'
    }
}
android.applicationVariants.all { variant ->
    variant.productFlavors.each {
        def buildType = variant.buildType.name.capitalize()
        println "$it.name$buildType $it.testApplicationId"
    }
}
Give following output:
firstDebug first
firstRelease first
secondDebug second
secondRelease second
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With