Skip to content

[Bug]: The app widget is unusable #5395

Closed
@sivaraam

Description

@sivaraam

Summary

The app widget is not usable at least on newer Android devices like those running Android 13. The widget doesn't show the image and the app crashes when opening after the widget is added.

Steps to reproduce

  1. Add the "Picture of day" widget from the app to your homescreen.
  2. Open the app.

Expected behaviour

The widget should show the oicture of the day properly on all supprted devices.

Actual behaviour

The wudget shows a blank screen. Further, the app crashes when opening after adding the widget.

Device name

Samsung SM-S918U

Android version

Android 13

Commons app version

4.2.1

Device logs

Full crash report

USER_COMMENT=just opened the app, and saw this message
APP_VERSION_CODE=1036
APP_VERSION_NAME=4.2.1
ANDROID_VERSION=13
PHONE_MODEL=SM-S918U
STACK_TRACE=java.lang.RuntimeException: Unable to start receiver fr.free.nrw.commons.widget.PicOfDayAppWidget: java.lang.IllegalArgumentException: fr.free.nrw.commons: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4903)
at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2420)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: java.lang.IllegalArgumentException: fr.free.nrw.commons: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:408)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:491)
at android.app.PendingIntent.getActivity(PendingIntent.java:477)
at android.app.PendingIntent.getActivity(PendingIntent.java:441)
at fr.free.nrw.commons.widget.PicOfDayAppWidget.updateAppWidget(PicOfDayAppWidget.java:54)
at fr.free.nrw.commons.widget.PicOfDayAppWidget.onUpdate(PicOfDayAppWidget.java:140)
at android.appwidget.AppWidgetProvider.onReceive(AppWidgetProvider.java:66)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:4894)
... 9 more

IS_SILENT=false
REPORT_ID=c8ec07ca-39ef-43f2-bd2d-7d1c21ea36e9
USER_CRASH_DATE=2023-11-19T19:16:45.378-05:00
USER_EMAIL= 

Screen-shots

No response

Would you like to work on the issue?

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions