xamarin 如何调试仅在发布模式下崩溃的Android应用

xam8gpfp  于 2022-12-07  发布在  Android
关注(0)|答案(7)|浏览(189)

Everything works in Debug Mode but Crashes in Release Mode. What required permissions are available in Debug Mode that are not turned on in Release mode?

EDIT

When I set Linking to None, I get past the first screen to my Login screen. However, when I added the Release permission Internet , the first time it tries to read a remote Entity Framework Core Table it crashes.

EDIT 2

In Release Mode, if I check Use Shared Runtime , the app runs fine.

EDIT 3

I have turned on Debugging while in Release mode Temporarily. The Following line throws a System.TypeInitializationException only in Release Mode:

if (_context.bma_users.Any(p => p.username == _name.Text) && _name.Text != string.Empty)
djp7away

djp7away1#

如果您只想查看崩溃日志:

假设您安装了Android Studio,但未实施崩溃报告服务(FirebaseCrashlytics等)
您可能需要先查看崩溃日志打印

  • 在Android Studio中打开Logcat。
  • Log Level变更为Error
  • 确保设备上启用了USB调试。
  • 将设备连接到计算机。
  • 让应用程序崩溃,看看它打印什么。

如果你不能繁殖
下一次崩溃时,连接设备并按上述操作。通常日志历史将可供查看,滚动直到找到崩溃:)
查找FATAL EXCEPTION

  • 请记住-使用Logcat搜索栏可以清除日志历史记录,在大多数情况下,您可以重新连接设备以再次查看。
oewdyzsn

oewdyzsn2#

你已经假设“许可”了,不知道为什么...
当我在发布模式下遇到崩溃时,我首先禁用的是minify(又名ProGuard)。因此,禁用模糊处理,重新构建并尝试查看是否仍然会崩溃。如果没有,一次启用一行proGuard以查明原因。

vlurs2pr

vlurs2pr3#

答案是在Project Properties下的Android Options屏幕中将Additional supported encodings设置为West。这似乎没有关系,但我尝试了所有可能的组合,最终成功了。

m4pnthwp

m4pnthwp4#

您可以只为release构建类型设置debuggable: true。完成调试后,不要忘记删除此属性。

wfypjpf4

wfypjpf45#

转到android部分的属性,然后进入Android选项选项卡。
确保在您的版本配置中取消选中“使用共享运行时”和“使用快速部署”框

djmepvbi

djmepvbi6#

您可以使用任何崩溃分析工具(如Firebase Analytics、Fabric、Splunk Mint)获取准确的崩溃日志

snz8szmq

snz8szmq7#

请检查crashlytics,他们提到的确切行号,你的应用程序崩溃。你可以看到什么错误显示,然后你可以修复。

相关问题