Android Studio不会在生成文件夹下生成映射文件夹
问题描述:
我只是想尝试使用proguard,以查看在使用it.i后,我的apk大小会减少多少,并且遵循了android开发人员网站的所有步骤。Android Studio不会在生成文件夹下生成映射文件夹
但android studio无法生成映射文件夹,我将如何知道我的应用程序的哪些代码被混淆。
添加尝试更改默认映射文件夹的路径通过将此规则添加到proguard文件,但没有奏效。 我正在使用android studio生成signed-apk。 -printmapping build/outputs/mapping/release/mapping.txt
apply plugin: 'com.android.application' apply plugin:'com.google.gms.google-services'
的Android { compileSdkVersion 25 buildToolsVersion '25 .0.2' useLibrary 'org.apache.http.legacy'
dexOptions {
incremental true
maxProcessCount 4
javaMaxHeapSize "3g"
}
defaultConfig {
applicationId "com.metronomic.materno"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
// Add the following two lines
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
lintOptions {
abortOnError false
}
buildTypes {
release {
debuggable false> minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), proguard-rules.txt'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
productFlavors {
} }}
答
你有 'buildTypes' 块两次,最后一个(这是Android Studio使用的)指定“minifyEnabled false”。
所以你的代码根本没有得到任何处理。
您不应该有2个buildTypes块。