![](/img/trans.png)
[英]Android App crashes in the release build due to NullPointerException when setting minifyEnabled to true and shrinkResources to true
[英]Android Proguard : Is minifyEnabled true automatically setting obfuscation to true?
我正在嘗試測試該應用程序,但是我想知道哪個選項真正啟用了混淆功能。
如果minifyEnabled
為false
,文件是否還會被混淆?
buildTypes {
debug {
// minifyEnabled true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
release {
// minifyEnabled true
// shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro',
'proguard-fresco.pro.txt'
}
}
要啟用保護或收縮代碼,請將minifyEnabled
設置為true
android {
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
...
}
閱讀https://developer.android.com/studio/build/shrink-code.html上的文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.