当我使用jsoup构建签名的APK时,应用程序崩溃了 [英] App crashed when i build a signed APK with jsoup
问题描述
当我构建签名的apk时,我的android应用程序崩溃了.我进行调试时看不到崩溃. build.gradle文件是这样的:
My android app was crashing when i build a signed apk. The crash was not seen when i did a debug build. The build.gradle file is like this:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
debuggable true
}
}
推荐答案
将minifyEnabled
设置为false
并不是正确的解决方案,在构建发行版本时会禁用proguard
setting minifyEnabled
to false
is not the correct solution, that would disable proguard while building the release version
设置minifyEnabled
起作用的原因是因为proguard可能混淆了jsoup.
因此,您应该将minifyEnabled
保留为true
,并在proguard-rules.txt文件中包含这些jsoup规则,以防止应用崩溃:
The reason why setting minifyEnabled
is working is because proguard might be obfuscating jsoup.
So, you should keep minifyEnabled
as true
and include these rules for jsoup in your proguard-rules.txt file to prevent the app from crashing :
-keep public class org.jsoup.** {
public *;
}
这篇关于当我使用jsoup构建签名的APK时,应用程序崩溃了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!