Hi All,

    I am trying to generate different Variants of same application using 
developer 
portal reference 
<https://developer.android.com/studio/build/build-variants.html>

*There can be a common entry point in Application. From where it can split 
according to build varient. Also some point both build varient may use 
common class logic also.*

This is how my *bundle.gradle* looks

apply plugin: 'com.android.application'

android {
 compileSdkVersion 24
 buildToolsVersion "24.0.1"

 defaultConfig {
 applicationId "mycom.projsplit"
 minSdkVersion 15
 targetSdkVersion 24
 versionCode 1
 versionName "1.0"
 }
 buildTypes {
 release {
 minifyEnabled false
 proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
 }
 }
 productFlavors{
 blue{
 applicationId "mycom.projsplit"
 }
 green{
 applicationId "mycom.projsplitsecond"
 }
 }
}


Now I have my common landing Activity with two different xml files . 1)  
activity_main 
for blue version 2)  activity_main for green version
I have put a button and according to product flavour, planning to navigate 
to two different activity

   MainActivity >
                        On Button Click     
                                            > IF BLUE     is Varient  > 
launch Blue   Activity
                                            > IF GREEN  is Varient  > 
launch Green Activity

The logic is as shown below


if(BuildConfig.FLAVOR.contentEquals("green")){
 startActivity(new Intent(MainActivity.this,GreeActivityTwo.class));
}else{
 startActivity(new Intent(MainActivity.this,BlueActivityTwo.class));
}

During compilation in BLUE VARIENT,  Android Studio is not able to find 
GreenActivityTwo.java

Similarly compiling in GREEN VARIENT , Android Studio is not able to find 
BlueActivityTwo.java
                                               
How to resolve this issue? Any help is highly appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to