Ant*_*ema 4 android android-debug android-proguard
我有一个 android 应用程序,它支持 android >= 4。在调试编译中,它有 > 65k 方法,因此它是 multidex。在发布中,我使用proguard,它有38k方法,并且不是multidex。我将如何开发一个在调试模式下可能崩溃的应用程序,仅仅因为它超过 65k 个方法?
我想我也可以在调试版本中使用 proguard,但没有看到有人这样做 + 使用 proguard 会花费更多时间进行编译,您将如何处理这种情况?
PS 我的 app.gradle 看起来像这样(依赖项部分):
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')
Run Code Online (Sandbox Code Playgroud)
我使用所有这些库
我在调试版本中使用 proguard。通常我的 build.gradle 看起来像这样:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
}
}
Run Code Online (Sandbox Code Playgroud)
请注意用于调试的不同 proguard 文件 (proguard-rules-debug.pro),其中添加了 -dontobfuscate 选项。
使用 proguard 编译它所需的时间大约长 5-10%,这对我来说是可以接受的。我没有使用即时运行,所以我不知道它是如何受此影响的。
| 归档时间: |
|
| 查看次数: |
6198 次 |
| 最近记录: |