[英]Android Studio not generating Mapping folder under Build folder
I just wanted to try proguard,to see how much my apk size will get reduced after using it.i followed all the steps from android developer site as well. 我只是想尝试proguard,以查看使用它后我的apk大小会减少多少。我也遵循了android开发者网站上的所有步骤。
but android studio not able to generate mapping folder, how will i know which code of my app is getting obfuscated. 但是android studio无法生成映射文件夹,我怎么知道我的应用程序的哪个代码越来越模糊。
add tried to change the path of default mapping folder by adding this rule to proguard file but didnt work. add尝试通过将此规则添加到proguard文件来更改默认映射文件夹的路径,但是没有起作用。 i am using android studio to generate signed-apk.
我正在使用android studio生成签名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' 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 {
} }}
You have the 'buildTypes' block twice, and the last one (which is the one that gets used by Android Studio) specifies "minifyEnabled false". 您有两次“ buildTypes”块,最后一个(Android Studio使用的块)指定“ minifyEnabled false”。
So none of your code is getting proguarded at all. 因此,您的任何代码都不会受到保护。
You should not have 2 buildTypes blocks. 您不应有2个buildTypes块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.