How to launch various products in Android Studio

I am writing my first Android application and I am just starting with products. I have an ad-supported application in beta, and I'm writing a paid version without ads. I think I can compile both tastes. When I open the gradle window, I see goals such as "compile AdsDebugSources" and "compile PremiumDebugSources".

Now, if I double-click on one of them, the assembly will complete without errors, but I cannot figure out how to run the results. If I click on the green “Run” arrow at the top of the screen, I can never launch a premium application.

There is only one entry, the “application”, as a result of which apk is installed and launched on the connected device, and this is the version of AdsDebug. I think I need to add a new configuration, but I can’t find the documentation that even mentions the word “aroma”.

I tried to add the configuration, but I do not understand what these questions mean. I looked at the default settings for the application, but they seem to mean little. How can I say that I want a premium version of my application?

Or my problem has nothing to do with configurations? I noticed that when I look at Build/Edit Flavors, two options are listed, but none of the data fields are populated. I would think that they would be copied from the manifest. Did I forget something?

, , , , build.gradle :

flavorDimensions "dummy"

productFlavors {
    ads {
        dimension "dummy"
        applicationId 'com.example.myApp.ads'
    }

    premium {
        dimension "dummy"
        applicationId 'com.example.myApp.premium'
    }

}

?

+4
2

Build Variants Android Studio. .

, , "".

Android Studio Build Variants tool

+8
+1

Source: https://habr.com/ru/post/1683929/


All Articles