apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.didi.virtualapk.demo" minSdkVersion 15 targetSdkVersion 15 versionName "1.0.0" versionCode 1 } flavorDimensions "demo" productFlavors { beijing { dimension "demo" applicationId 'com.didi.virtualapk.demo' } shanghai { dimension "demo" applicationId 'com.didi.virtualapk.demo' } } signingConfigs { release { storeFile file("../../keystore/test.keystore") storePassword "test123456" keyAlias "test" keyPassword "test123456" } } buildTypes { debug { minifyEnabled false shrinkResources false } release { minifyEnabled true shrinkResources true signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { // the following aars are also compiled in host project, so they will be filterd when build plugin apk. // but, wo can still visit their Class and Resources. compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.didi.virtualapk:core:0.9.5' } apply plugin: 'com.didi.virtualapk.plugin' virtualApk { packageId = 0x6f // the package id of Resources. targetHost = '../../VirtualAPK/app' // the path of application module in host project. applyHostMapping = true //optional, default value: true. }