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

Widget cannot be deleted in state with text "widget cannot be added" #445

Closed
Catfriend1 opened this issue Nov 2, 2018 · 14 comments
Closed

Comments

@Catfriend1
Copy link

Device: Xiaomi Mi8
OS: Android 8.1.0 MIUI 10
App: OpenLauncher-fdroid-0.6.0

Reproducer

  • add widget
  • widget displays correctly
  • reboot device
  • widget stays black with text "widget cannot be added"
  • widget cannot be deleted (delete popup doesn't show when clicking it)
@dkanada
Copy link
Member

dkanada commented Nov 3, 2018

Which widget isn't working on your phone? I will download the app and test it out to see if I can reproduce the issue.

@Catfriend1
Copy link
Author

So far I've already tested this happens to many apps. For example Tasker and domoticz had this problem. 1&1 weather widget works correctly. I also had the same problem with disappeared widgets on MIUI Launcher, so I'd suspect it's a special xiaomi phone issue. Are there any logs I can grab specifically on certain tags shortly after boot?

@dkanada
Copy link
Member

dkanada commented Nov 3, 2018

Yeah that could be the issue, I couldn't reproduce this bug with any of my widgets. Do you have any apps I could test that aren't paid apps? Domoticz Lite doesn't support widgets and Tasker only has a paid version.

@Catfriend1
Copy link
Author

I tried with the app https://f-droid.org/en/packages/net.etuldan.sparss.floss/ . It's surviving reboots and the widget stays there but if I use Xiaomi local backup , the text "widget cannot be added" just after the app was backed up. You can also reproduce this using ADB backup command from shell or adebar (backup tool for adb by izzysoft) if you don't own a Xiaomi device. I captured two logs for you. (1) is during backup until backup was taken and (2) is after backup when switching to openlauncher to the page that contains the widget.
screenshot_2018-11-03-11-32-25-521_com benny openlauncher
Openlauncher_widget_lost_after_backup.zip

@dkanada
Copy link
Member

dkanada commented Nov 3, 2018

Wait is the issue from just restarts or from restoring a backup? Those are two separate things, a restart means this could be a widespread issue, I don't think third party backups are even supported although they should technically work.

@Catfriend1
Copy link
Author

Hmm, playing around it seems to be two different issues:

  • Domoticz App and Tasker sometimes lose the widget on restart (I have no proof but a bad feeling the autostart-restrictions from Xiaomi MIUI ROM may cause this!?)
  • adb backup force stops (or freezes?) apps and that leads to the widget never being added again. (taking the previous suspect into account maybe that's Xiaomi specific too).
    So I understand your point very well if you say "adb backup" is not supported or customizations Xiaomi made to their firmware are not supported - but - if there's a way to work around this (as it's also happening in the official MIUI launcher since 2016) would be great and very appreciated.

For a starting suggestion: Is it possible for example to build a debug version that retries adding the widget after it failed some minutes later? My intuition somehow tells me that this could maybe solve the issue as I'm always able to add the widget again.

Issue (3) would be: A failed widget with the text "widget cannot be added" like in the screenshot above cannot be removed > I would consider this a bug.

@seb1458
Copy link

seb1458 commented Nov 5, 2018

Wait is the issue from just restarts or from restoring a backup? Those are two separate things, a restart means this could be a widespread issue, I don't think third party backups are even supported although they should technically work.

I have the problem with two widgets: simple calendar and the stock clock widget. I run Lineage OS and the widgets disappear after the restart of my phone. BUT I tested this also on the Evie Launcher and the widgets crashed there as well.

EDIT: I realized the problem was the location of the installed app. I had OpenLauncher on my external storage. After moving it to internal storage the widgets are working just fine. This does not solve the initial problem though.

@dkanada
Copy link
Member

dkanada commented Nov 7, 2018

@Catfriend1 do you have any apps installed on an external card like @seb1458 was describing?

@Catfriend1
Copy link
Author

Good point but, no I don't have an sdcard as the phone hardware only offers internal storage.

@dkanada
Copy link
Member

dkanada commented Dec 29, 2018

I will have a possible fix for this issue on the next release, probably after the holidays are over. A lot of these disappearing item issues are all related so I am trying to fix them all in the next release.

@Catfriend1
Copy link
Author

I'm happy to test a debug apk for you if you need the feedback before release.

@Catfriend1
Copy link
Author

Ok, tested 0.7.0 like I said in #490 I'm still unable to delete the stuck widgets. Will never add widgets again on miui because they are broken after running adb or miui backup on the apps. I didn't store anything on external as the Phone has internal storage only.

@ashokgaire
Copy link

this comment is for the developer who is working on this issues...

just change some lines in the code
1.return new WidgetView(context.getApplicationContext()) from WidgetHost.java class
2. _appWidgetManager = AppWidgetManager.getInstance(getApplicationContext()); on HomeActivity.java init() method
..
error info :: W/AppWidgetHostView: updateAppWidget couldn't find any view, using error view android.widget.RemoteViews$ActionException: view: android.support.v7.widget.AppCompatImageView can't use method with RemoteViews: setImageResource()...

@gsantner
Copy link
Contributor

Closing in favor of the Meta issue for Widgets #645 . Please have all discussion at that issue, including crashes, feature requests and more. I also lock this issue as there is nobody that wants to continue to reply on ~100+ mostly duplicate issues.

Currently nobody is working on OpenLauncher Widgets code, so why YOU who reads this message, not steps up? 😉

@OpenLauncherTeam OpenLauncherTeam locked and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants