android - Setting debuggable true for specific flavor Releases -


how can defined debuggable=true enabled in releasebuildconfig, specific set of flavors:

this example code, including trial (which not work):

flavordimensions "project", "environment"  productflavors {     basic  {         dimension "project"     }      advanced {         dimension "project"     }      flavordevelopment {         dimension "environment"         applicationid "ch.myproject.app.development"         debuggable true  // not work     }      flavortest {         dimension "environment"         applicationid "ch.myproject.app.test"         debuggable true  // not work      }      flavorintegration {         dimension "environment"         applicationid "ch.myproject.app.integration"         debuggable true  // not work     }      flavorproduction {         dimension "environment"         applicationid "ch.myproject.app.production"         // here debuggble has on default (in buildtypes.debug  = on  , in buildtypes.release = off )         // working     } 

the "debuggable true" statements wont work in code example above. should give impression, try make.

the productive release i' gona make flavorproduction. there i'm using default behavior working fine.

but other internal releases flavordevelopment, flavortest, flavor integration, have enabled debugging capability.

i tried second approach:

    applicationvariants.all { variant ->     // setting releases expecting production 1 debuggable     if (!variant.buildtype.name.contains("productionrelease")) {         variant.buildtype.debuggable = true     } } 

but there i'm getting message:

error:(132, 0) cannot set readonly property: debuggable class: com.android.build.gradle.internal.api.readonlybuildtype 

does know how configure gradle?

thanks in advance luke

there way achieve this, set debuggable attribute true in manifest in every source set of expected product flavors.

step 1: create source set of product flavors.
new source set in app/src/[flavor-name] , create androidmanifest.xml in it. following:

enter image description here

step 2: define debuggable in manifests

enter image description here

tools:ignore="hardcodeddebugmode" used suppress warnings.

that's it, you're go. no need touch build.gradle files.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -