How to Run Different Product Flavors in Android Studio -
i'm writing first android app, , i'm getting started product flavors. have ad-supported app in beta, , i'm writing paid version no ads. can compile both flavors, think. when open gradle window, see targets "compile adsdebugsources" , "compile premiumdebugsources."
now, if double-click on either of those, build runs completion without error, can't figure out how run results. if click on green "run" arrow @ top of screen, can never run premium app.
there's 1 entry, "app" results in apk being installed , run on attached device, , it's adsdebug version. guess need add new configuration, can't find documentation mentions word "flavor."
i've tried adding configuration, don't understand questions mean. looked @ settings default app, don't seem mean much. how tell want premium version of app?
or problem have nothing configurations? i've noticed when @ build/edit flavors
2 flavors listed, none of data fields filled in. have thought these copied manifest. have neglected something?
all did set flavors add code app level build.gradle file:
flavordimensions "dummy" productflavors { ads { dimension "dummy" applicationid 'com.example.myapp.ads' } premium { dimension "dummy" applicationid 'com.example.myapp.premium' }
}
what else need do?
open build variants tool in android studio. default, docked on left.
it show list of modules in project, drop-down each indicating build variant used run button.
Comments
Post a Comment