I have an android app, which supports android >= 4. In debug compilation it has > 65k methods, thus it is multidex. In release, I use proguard, and it has 38k methods, and is not multidex. How would I develop an app, which in debug mode can crash, just beacuse it is over 65k methods?
I thing I can use proguard in debug builds too, but didn't see anyone doing it + it would take much more time on compilation, using proguard How would you handle this situation?
PS my app.gradle looks like this (dependency's section):
compile project(':signalr-client-sdk-android')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:+'
compile "com.nostra13.universalimageloader:universal-image-loader:${UNIVERSAL_IMAGE_LOADER}"
compile "de.hdodenhof:circleimageview:${CIRCLE_IMAGE_VER}"
compile "com.pixplicity.multiviewpager:library:${MULTIVIEW_PAGER_VER}"
compile "com.michaelpardo:activeandroid:${ACTIVE_ANDROID_VER}"
compile "com.squareup.okhttp:okhttp:${OKHTTP_VER}"
compile "com.rockerhieu.emojicon:library:${EMOJI_VERSION}"
compile "com.facebook.android:facebook-android-sdk:${FACEBOOK_SDK_VER}"
compile "com.makeramen:roundedimageview:${ROUNDED_IMAGEVIEW_VER}"
compile 'com.github.orangegangsters:swipy:1.2.0@aar'
compile "com.google.android.gms:play-services-gcm:${GSM_VER}"
compile "com.google.android.gms:play-services-analytics:${ANALITICS_VER}"
compile "com.flurry.android:analytics:${FLURRY_VER}"
compile 'com.supersonic.sdk:mediationsdk:6.3.6@jar'
//effects apng tool
compile project(':android_api')
compile project(':flingCards')
compile files('libs/protobuf-java-2.6.1.jar')
And I use all of this libs
I use proguard in debug builds. Usualy my build.gradle looks like this:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
}
}
Notice the different proguard file (proguard-rules-debug.pro) for debug which has -dontobfuscate option added.
The time it takes to compile it with proguard is about 5-10% longer which is acceptable to me. I'm not using instant run so I don't know how it's affected by this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With