Skip to content

Instantly share code, notes, and snippets.

@Aracem
Forked from cdsap/AndroidManifest.xml
Last active August 29, 2015 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Aracem/8610f132caddd2de6125 to your computer and use it in GitHub Desktop.
Save Aracem/8610f132caddd2de6125 to your computer and use it in GitHub Desktop.
Use alias in the Android Manifest. Currently only available in the flavours, not in the buildTypes
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapplication" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MyActivity"
android:label="${label}" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.myapplication"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
manifestPlaceholders = [label: "defaultName"]
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
flavor1 {
manifestPlaceholders = [label: "flavor1"]
}
flavor2 {
manifestPlaceholders = [label: "flavor2"]
}
flavor3 {
manifestPlaceholders = [label: "flavor3"]
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment