Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

App crashes with Xiaomi Redmi devices

AndreaGobsAndreaGobs Member ✭✭
edited September 2020 in Xamarin.Forms

My Xamarin.Forms app (Android + iOS) is published into the Play Store + Apple Store from one year and the only devices I have problem with are of the Xiaomi Redmi family.
I use also a Xiaomi Mi A2 Lite device for debug, but with this one a have no app installation error or crashes.
I don't really know if it could be a Xamarin issue or a my deployment error.

My release configuration into the MyApp.Android.csproj is the following:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <MandroidI18n />

PS I'm using Xamarin.Forms 4.8 and Visual Studio Community 2019 16.7.2

Do you have any idea or suggestion?

Best Answer


  • JohnHardmanJohnHardman GBUniversity admin
    edited September 2020


    Do you collect exception details using App Center or similar?
    Do you have access to exception details via any other route?

    Is it possible that the Xiaomi Redmi devices are being used in a different locale to that in which you test? If so, is it possible that they don't have access to services that your app depends on (e.g. Google maps, which may not be accessible in mainland China and some other countries).

  • AndreaGobsAndreaGobs Member ✭✭
    Accepted Answer


    Finally we found the origin of the issue:

    And the proposed work around works (

    Anyway, now I'm starting to collect exception details via App Center :)

  • JohnHardmanJohnHardman GBUniversity admin
    edited September 2020


    Glad you found the cause of the problem. Never would have guessed it from the original post :-)

    Regarding Device.Idiom - I've always found it best to avoid Device.Idiom.
    The different values are documented now (it used to mean searching the XF source code to find out what each value actually meant). Details are at . However, even now that it's documented, I suspect that the distinction between Desktop, Tablet and Phone is often not the distinction that is really required by apps. If the question is, does the device have the ability to make a call (telephone or otherwise), using Device.Idiom isn't suitable, as it's not just small-screen devices that can make calls. If the question is, does the app have more than a certain amount of space on screen to render its UI, the test needs to take into account that the user might have more than one app sharing screen space, and that the amount of space might change whilst the app is running. Obviously, it depends on your particular scenario, but I avoid Device.Idiom in all but the simplest of situations.

    Also, where documentation now exists of the values used for Device.Idiom, the documentation for Xamarin.Essentials at doesn't seem to document what conditions it uses to identify different idioms. The assumption is that it would be the same as Device.Idiom, but the issue that you referenced would suggest otherwise.

    cc @DavidBritch

Sign In or Register to comment.