5/24/2023 0 Comments Build variant in android studio![]() ![]() This is weirdly amusing, because the whole "you just bundle everything up and do if/else throughout your app" was the approach that Huawei had pushed so I'm guessing this will affect a lot of folks I did a split for HMS/Play a while back when it came out.īut now, due to Google having a problem with my app including a Huawei SDK I tried leaving the Google Play Location class inside the "main" folder and only putting the Huawei Location class inside the "releaseHuawei" folder, but the compiler told me the classes are duplicate, which makes sense and I understand why.Ĭan someone help me figure this out? I feel like the right answer lies somewhere in "flavorDimensions", but I've read the documentation on that and I fon't fully grasp the concept.īasically, I want to be able to compile the project into following build variants, without having to put too much complexity into my src folder structure. I tried simply adding another build type called "releaseHuawei" but then my Location classes wouldn't be added to debug builds. How can I add 2 more dimensions to these build variants, so that for every product flavor, I can choose between huawei and google play as well. ![]() This would give me the following build variants, which is exactly what I needed:īut now, due to Google having a problem with my app including a Huawei SDK (the app is being submitted to both GPlay and Huawei stores), I need to make sure that the Huawei SDK is not compiled in builds that are being submitted to their stores. The reason for this is that I am indeed compiling the project into two different apps with different package names, that are also submitted under different app names. This is how I started out and it worked for a while: I recently had to introduce Build Variants to an app that I'm building due to the demands of a client. Edit: I have posted the solution below in the comments.
0 Comments
Leave a Reply. |