简体   繁体   English

Xamarin Forms 我的应用程序无法在 Android 12 上运行

[英]Xamarin Forms my app not working on Android 12

My application works for all versions of Android except 12, Xamarin Forms does not show me the problem but Play Console showed me, I don't know how to solve this problem enter image description here我的应用程序适用于 Android 的所有版本,除了 12、Xamarin Forms 没有向我显示问题但 Play Console 向我显示,我不知道如何解决此问题在此处输入图像描述

I hope to solve this problem我希望解决这个问题

There could be many problems with the code, and that error is really ambiguous.代码可能有很多问题,而且那个错误真的很模棱两可。

When working with Android you need to know that there are many versions, as you can see in the version history: https://en.wikipedia.org/wiki/Android_version_history在使用 Android 时,您需要知道有很多版本,您可以在版本历史中看到: https://en.wikipedia.org/wiki/Android_version_history

There are some functionalities, such as the NotificationCompat Builder that change between versions.有一些功能,例如在版本之间变化的 NotificationCompat Builder。 You should review your code and see which methods might differ given the version.您应该检查您的代码,看看哪些方法可能因版本而异。

You are probably going to need to make this comparison:您可能需要进行以下比较:

if (Build.VERSION.SdkInt < BuildVersionCodes.S)

At some point in your code and make two different versions of a functionality for it to work on multiple devices.在您的代码中的某个时刻,制作一个功能的两个不同版本以使其在多个设备上运行。

I recommend to test on different physical or emulated devices with versions at least from Android Oreo upwards to cover most phones currently in the market.我建议在版本至少为 Android Oreo 的不同物理或模拟设备上进行测试,以覆盖目前市场上的大多数手机。

Best regards.最好的祝福。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM