Forum Xamarin.Android

Announcement:

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 shortcut disappears after every update / install

Prior to the last update from Xamarin out app shortcuts were never removed from the home screen, but now they are getting removed / deleted every time we install an update to our app. The only thing we change is the build # in AssemblyInfo.cs such as:

[assembly: AssemblyVersion("7.0.1.02198")]

to

[assembly: AssemblyVersion("7.0.1.02199")]

Again, before updating to the latest version of Xamarin, it didn't remove our shortcuts from the home screen. Any ideas on how to stop it from deleting the shortcut?

Best Answers

Answers

  • My app has always got removed from the home screen when I debug. As far as I can tell, Xamarin removes the old version and installs the new version when it deploys. I'm surprised it ever worked for you.

    Google's Android Studio (and Eclipse before it) would install over the old version, leaving the shortcuts.

  • FrankCardozaFrankCardoza USMember

    I should have mentioned that this is actually happening to our customers when they install a new APK.

  • @FrankCardoz That sounds like a bug. Is it happening on certain devices. I wonder if a certain manufacturer or launcher is at fault.

    Have you changed the MainLauncher activity's class name? Going so will cause the shortcut to get deleted.

  • FrankCardozaFrankCardoza USMember
    edited August 2015

    It happens on several devices and they were devices known to work in the past. We haven't changed the MainLauncher activity's name. I doubled checked since you mentioned to be sure.

    On one device instead of deleting the shortcut, it leaves it there but when the customer tries to open it then it says "Application Not Installed". Most simply delete the shortcut though.

  • FrankCardozaFrankCardoza USMember

    We did a diff and we didn't notice anything out of the ordinary. Is there something particular we should look for? We did notice when we upgraded we had to switch libraries for Android.Support.v4 as the newer version of Xamarin removed support for the Mono lib. Attached is the full diff.

    345a361

    assemblies/Xamarin.Android.Support.v4.dll

    348d363
    < assemblies/Mono.Android.Support.v4.dll
    diff.txt 502.6K
  • FrankCardozaFrankCardoza USMember

    Thank you very much for pointing us to that. Based on this change recent change by Xamarin:

    http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.0/#Android_Callable_Wrapper_Naming

    The Activity's name will be randomized each time. It talks about how to force a name and if we force our main activity to what it was prior then the shortcut is not deleted. We basically changed our [Activity()] attribute to include: Name="Full Name of Activity" and now everything is as it was.

  • That's great. I realized that our clients probably had this same issue, and I didn't even know.

  • CameronKlenkCameronKlenk USMember ✭✭

    We too are having issues with our app shortcut disappearing. I have set an explicit Name activity attribute on our MainActivity class for Android. Even when setting the name it still disappears. Does the Name attribute have to match the class name?

  • ThibaultDThibaultD SEMember ✭✭✭

    @FrankCardoza said:
    Thank you very much for pointing us to that. Based on this change recent change by Xamarin:

    http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.0/#Android_Callable_Wrapper_Naming

    The Activity's name will be randomized each time. It talks about how to force a name and if we force our main activity to what it was prior then the shortcut is not deleted. We basically changed our [Activity()] attribute to include: Name="Full Name of Activity" and now everything is as it was.

    I'm a bit late on this, but it seems to me that

    MD5SUM of the assembly-qualified name

    Would mean that the md5 sum would not change if the assembly-qualified name does not change.

    But I'm encountering the same issue and I'm trying to find out what's triggering the md5 change.

    So I wonder, what does this piece of documentation exactly mean with assembly-qualified name ?

  • ThibaultDThibaultD SEMember ✭✭✭

    After some experiments and reading the docs about the assembly qualified name I realized that changing the AssemblyVersion of my Properties/AssemblyInfo.cs changes the md5 hash.

    The AssemblyVersion is part of the assembly qualified name so that is to be expected.

    Solution: Don't bump your AssemblyVersion at every release, like I was doing.

Sign In or Register to comment.