Android - ProGuard 修改导致应用程序崩溃
我的应用程序在未签名(调试等)时以及在没有 ProGuard 的情况下导出时都可以正常工作。 但是当我用 ProGuard 导出它时,当我导入的一段包含本机方法的代码正在执行时,它崩溃了。
我能做些什么?我想获取堆栈跟踪,但我不知道该怎么做...
我已经尝试过: 如何从 Android 应用程序获取崩溃数据? 但实际上没有文件出现在应有的位置(我想我也做错了:(
)设备必须保存崩溃堆栈跟踪他们在哪里?
My app works fine when it's unsigned (debugging, etc..), also when exporting without ProGuard.
But when I export it with ProGuard, When a piece of code containing native methods that I import is executing, it crashes.
What can I do? I guess that getting the stack trace, but I have no idea how to do that...
I have tried this: How do I obtain crash-data from my Android application? But no files actually appear where they should (I guess I have done that wrong too :()
The device MUST be saving crash stack traces SOMEWHERE. Where are they?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
项目中的 proguard.cfg 有一组不应混淆的类的忽略规则。您基本上可以忽略一切并慢慢地混淆每次传递的代码。本机方法、通过反射间接调用的方法不应被混淆。
The proguard.cfg in your project has a collection of ignore rules for classes that shouldn't be obfuscated. You can essentially ignore everything and slowly obfuscate code each pass. Native methods, methods called by reflection-indirection shouldn't be obfuscated.
如果您使用 Fragment 类,请将以下行添加到您的 proguard.cfg 文件中:
If you are using Fragment class add the following line to your proguard.cfg file: