Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HomeWidget.updateWidget not working on Android Release Mode #268

Open
th8m0z opened this issue Jun 19, 2024 · 5 comments
Open

HomeWidget.updateWidget not working on Android Release Mode #268

th8m0z opened this issue Jun 19, 2024 · 5 comments
Labels
p:Android Android Home Screen Widgets

Comments

@th8m0z
Copy link

th8m0z commented Jun 19, 2024

The widget is not being updated on release mode on Android, debug mode works perfectly.

Logs from Crashlytics show this error:

PlatformException(-3, No Widget found with Name null. Argument 'name' must be the same as your AppWidgetProvider you wish to update, java.lang.ClassNotFoundException: app.routineflow.routineflow.glance.HomeWidgetReceiver at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:536) at java.lang.Class.forName(Class.java:467) at es.antonborri.home_widget.a.onMethodCall(Unknown Source:522) at hh.j$a.a(Unknown Source:17) at wg.c.l(Unknown Source:18) at wg.c.m(Unknown Source:41) at wg.c.i(Unknown Source:0) at wg.b.run(Unknown Source:12) at android.os.Handler.handleCallback(Handler.java:1013) at android.os.Handler.dispatchMessage(Handler.java:101) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:328) at android.app.ActivityThread.main(ActivityThread.java:9190) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) Caused by: java.lang.ClassNotFoundException: app.routineflow.routineflow.glance.HomeWidgetReceiver ... 17 more , null)

@ABausG
Copy link
Owner

ABausG commented Jul 10, 2024

Can you try:

  • Use the fully qualified Android Name (using the package import)
  • Add your widget receiver class app.routineflow.routineflow.glance.HomeWidgetReceiver to the pro guard file so it can find the class even in a shrunk release build

@ABausG ABausG added the p:Android Android Home Screen Widgets label Jul 10, 2024
@MakhmudovBekhruz
Copy link

The same issue, please help asap, it is very urgent now

@ABausG
Copy link
Owner

ABausG commented Jul 12, 2024

  • Can you additionally provide the way you are calling HomeWidget.updateWidget
  • Have you tried the steps I mentioned above?

@MakhmudovBekhruz
Copy link

@ABausG yes I tried those steps but it did not help. Profile and Debug mode are working fine. Problem only in release mode

Flutter version: 3.22.1

@ABausG
Copy link
Owner

ABausG commented Jul 12, 2024

Can you paste in your proguard.rules file?

You will then need to whitelist your AppReceiver in order for it to be found when the platform files get obfuscated

(Plus please your call to HomeWidget.updateWidget)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:Android Android Home Screen Widgets
Projects
None yet
Development

No branches or pull requests

3 participants