I recently merged 4 similar but independent apps into one gradle project 
and setup gradle to use build variants for deploying each one 
independently. Because I've merged these projects that were previously 
independed, I needed to rename some packages, including the package for the 
launcher activity. In order to preserve the launcher links for my current 
user base, I wanted to use an activity-alias to point the old launcher 
links to the new launcher activity. So far so good. However, since I have 
multiple build variants, I need several different aliases to link back to 
the new launch activity. I looked into gradle's new manifest merging 
solution and looked into using placeholders for the alias name, however, 
when I drop the placeholder under the alias, it refuses to aknowledge the 
right package.

Below is the activity-alias from my manifest and the gradle build file. I 
need to find a way to insert the package name for each build variant into 
the alias for each build I do. com.stuart.android.main is the common 
package among all flavors and is the location of the new launch activity. 
Any help is appreciated!

*Manifest*
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"; 
package="com.stuart.android.main" android:installLocation="auto">
    <application android:icon="@drawable/icon" 
android:label="@string/app_name" android:allowBackup="true"
    android:theme="@style/appTheme">
        <activity-alias
            android:name=".SelectModeActivity"
            android:targetActivity="com.stuart.android.main
.SelectModeActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>
    </application>
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19"/>
</manifest> 

*build.gradle*
productFlavors {
    flavor1 {
        packageName "com.stuart.android.flavor1"
    }
    flavor2 {
        packageName "com.stuart.android.flavor1"
    }
    flavor3 {
        packageName "com.stuart.android.flavor1"
    }
    flavor4 {
        packageName "com.stuart.android.flavor1"
    }
}

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to