I have an app that reference ~ 100K methods, with min Sdk = 16
Here is 2 option for assembling:
- Proguard shrink this bunch of methods to only 44K methods
- Use Multi Dex
Now I have some common use cases:
- Run and debug on emulator and devices
- It requires to be as fast as possible
- Do tests (Integration and UI)
- It requires to run (I have some issue running Espresso with MultiDex)
- Make the Prod APK
- It requires to be reliable and shrinked as possible
Do you have guys some recommandation about the assembling strategy ?
3/ Prod
- Use Proguard to reduce APK size
- Use Proguard to obfuscate
- Do not use Multidex as most as possible (it may failed)
2/ Test
- Use minSdkVersion 21 (I read that starting by 21 enable pre-dexing, that saves time)
- ???
1/ Debug
- Use minSdkVersion 21 (I read that starting by 21 enable pre-dexing, that saves time)
- ???
Here is the Gradle file :
productFlavors {
dev {
minSdkVersion 21
multiDexEnabled ???
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
multiDexEnabled false
}
}
defaultConfig {
applicationId "xxxx"
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
versionCode ANDROID_BUILD_VERSION_CODE
versionName ANDROID_BUILD_APP_VERSION_NAME
}
buildTypes {
release {
debuggable false
ext.enableCrashlytics = true
renderscriptOptimLevel 3
signingConfig android.signingConfigs.release
zipAlignEnabled true
minifyEnabled true
// shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
renderscriptOptimLevel 3
applicationIdSuffix ".debug"
versionNameSuffix "debug"
minifyEnabled false
}
}