

I have tried cleaning and rebuilding the project, and restarting Android Studio with no success. We also have googlestring.xml file at the google/ source set to hold our api key for map.I recently updated Android Studio to version 0.3.0 and now there are no build variants I can choose from. If you take a quick look to both layout files, you can see fragments are coming from different dependencies. Since Huawei and Google different dependencies, we need to prepare layouts seperately for each variant and put those layouts to the correct directories respectively. Current active build variant can be found on the left handside of the Android Studio in Build Variants tab.Ĭlass MainActivity : AppCompatActivity () ĭepending on which variant is active, Android Studio will pick the relevant MapHelper class and build the project accordingly. How to implement Google Map Let’s Start How can I see which variant I am using right now?Īndroid Studio offers two different build variants by default “debug” and “release”. I am assuming you already know the implementation of the HMS and GMS Map Kits so I will not cover how to implement them in detail. In This Example, I will use different build variants for implementing Huawei & Google maps in demo project. To add new build types, however, you must add them to your module-level adle file and inside the buildTypes block. Different apks for different api levels 3 - How to Implement Before You Start! By default, when you start a new project, Android Studio will create two build types for it: debug and release. We can easily edit or add more build types and product flavors, creating way too many build variants we need. Even if only second one is mentioned in adle file in buildTypes section. Different apks for Huawei and Google implementations After we create new project we already have 2 build variants to select: debug and release. Different apks for demo and full version of your project

Build variant is a feature of Android Studio to create a project which can be build in different versions (flavors) 2 - What are the Benefitsīy using Build Variants, you can create multile different versions of your apk by only using single codebase. Build variant is a feature of Android Studio to create a project which can be build in different versions (flavors) 2 What are the Benefits By using Build Variants, you can create.
