frakbot / FWeather

A weather widget for Android based upon Tobias van Scheider's Authentic Weather design.
https://play.google.com/store/apps/details?id=net.frakbot.FWeather
91 stars 34 forks source link

NPE in 2.2.9 #112

Closed frapontillo closed 10 years ago

frapontillo commented 10 years ago

And then hell broke loose. As of 2.2.9 we are receiving plenty of NPEs:

java.lang.NullPointerException
at android.widget.RemoteViews$SetOnClickPendingIntent.writeToParcel(RemoteViews.java:147)
at android.widget.RemoteViews.writeToParcel(RemoteViews.java:1376)
at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.updateAppWidgetIds(IAppWidgetService.java:374)
at android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:246)
at android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:265)
at net.frakbot.FWeather.updater.UpdaterService.onHandleIntent(UpdaterService.java:164)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.os.HandlerThread.run(HandlerThread.java:60)

The affected devices are (wait for it... wait for it...) Samsung:

We have also received 1-star feedbacks (...) and several emails of people who complained the widget always crashes.

frapontillo commented 10 years ago

The problem has started occuring since 2.2.4, that is since the introduction of the sharing function. It should be related to some PendingIntent being null or somehow invalid.

See http://stackoverflow.com/questions/6060181/android-widget-null-pointer-exception-when-using-setonclickpendingintent-on and http://www.blogosfera.co.uk/2013/09/unable-to-start-receiver-crash-for-widgets-on-android-4-0-4-device/.

UPDATE: This is the same issue as #105, that wasn't solved by 20468927e0bd1fedd8bc7905e709381ce63a18bc. Besides the refresh PendingIntent, there is the "share" PendingIntent as well.

Since it looks like there's no way to avoid the bug, we can either opt to:

This needs to be fixed ASAP.

rock3r commented 10 years ago

I'd probably just hide the share button when we don't have data. Simple and makes perfect sense.

frapontillo commented 10 years ago

That'd be a valid option as well.

rock3r commented 10 years ago

Then go for it :)