Skip to content Skip to sidebar Skip to footer

Widgets Gone After App Update

After updating my app sometimes all old widgets disappear from home screen. And in app launcher/widget chooser my three widgets appear twice - until reboot! Any suggestions?

Solution 1:

On this page there is a long article talking about this issue.

The core of the issue seems to be this:

It is important that we use our own keys with the widget update action, if we use AppWidgetManager.EXTRA_WIDGET_IDS we will not only break our own widget, but others as well.

Unfortunately my code is not affected by this issue but I still have users reporting the issue. Also found this report

Solution 2:

My widgets disappeared after upgrading S4 to android lollipop. Discovered by accident that if you double tap the left soft key there is a widget icon at the bottom of the screen. Tap the icon to open widgets and there they all are!

Solution 3:

This is an OS bug, because of the way it updates apps, making them unavailable for quite some time. If a launcher is updating the widgets during that time, it will likely dismiss them, except if it implements a specific workaround to avoid this situation.

Please stare at the issue here so that (maybe) Google considers fixing it: https://code.google.com/p/android/issues/detail?id=188137

Solution 4:

if you change exact package path for a widget that'll break the upgrade and widget will disappear on upgrade

Solution 5:

This question give us a solution.

We were implementing Xamarin.Android project using MvvmCross. This project uses widgets, and on app update the widget disappeared. The question mentioned in the link give us a path to find the solution, We used APK-Analyzer to analyze the difference between old and new APKs, and by looking into AndroidManifiest.xml files we figured out that the used AppWidgetProvider has a different package name. By searching more we found a release note from Microsoft which says:

The names for generated Java types are different in this release. Any project that explicitly uses one of the old names that starts with md5 will need to be updated by hand to account for this change. See Breaking change for generated Java type names below for more details.

And by defining a constant name by replacing the following from:

[BroadcastReceiver(Label = "Widget Title")]
publicclassCustomProvider : AppWidgetProvider

to

[BroadcastReceiver(Label = "Widget Title", Name = "<old package name>.CustomProvider")]
publicclassCustomProvider : AppWidgetProvider

the problem solved.

Post a Comment for "Widgets Gone After App Update"