Incorrect icons with Visual Studio 2019

Steven_Steven_ USMember ✭✭

After updating and building APKs with Visual Studio 2019 (16.2.0, Xamarin.Android 9.4.0.51), we have started receiving reports that our icons were different or changing over time within our Android apps.

I was able to look at a few different devices, and could confirm that the icons were definitely changing. I've attached a "Correct" example, and an "Incorrect" example.

The devices always start with the correct icon set, but they will eventually switch and start using a "random" set of icons instead - although they are existing icons within the app. Every icon changes within the app. The problem persists, even if you force close the app. It's almost as if the resource IDs are switched or changed, and then cached - but since they are automatically generated, our app has no direct control over that.

The icons can be switched back to the correct set by restarting the device, or by reinstalling the APK from the app store - however, over time the app will go back to the incorrect set - and stranger still, it will be the same incorrect icons ("pin" becoming "box", "white refresh" becoming "black refresh", etc).

I cannot find a cause for why this is happening, because I cannot reliably reproduce the issue. I suspect that it is caused when app is suddenly or unexpectedly closed, but this does not happen every time. I've seen this happen in debug builds, as well as release builds.

This issue does not occur if the APKs are built with Visual Studio 2017.

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Are these icons not put in the drawable folder and use these icons used like following screenshot?

    If so, please create two new icons with unique names, then put these icons in the drawable folder, use these icons from the drawable folder in your application, If this issue is existed?

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    @Steven_ Are there any updates for this issue? If the reply is helpful, please mark it as an answer, it will help others who have similar issue.

  • Steven_Steven_ USMember ✭✭

    All the drawables resolve correctly in intellisense, and are given appropriate IDs in the "Resource.Designer.cs" file. They will be selected correctly at runtime, until this issue occurs. After that, the icons will be incorrect until the app is re-installed or the device is restarted.

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    I test it my VS 2019, I cannot pre-produce this issue, could you provide a demo to re-create this issue?

Sign In or Register to comment.