When loading a widget if it cannot find a resource or something it says Problem Loading Widget. That\'s all! Amazing! This message remains on the home screen and does not even s
Yet another possible cause of this:
I saw this in the log:
Failed to resolve attribute
The issue was that I was attempting to use a colour from the current theme as the background to one of my layouts.
e.g
android:background="?themeColor"
Changing this to a specific colour resolved the issue.
android:background="@color/White"
I was also having the same problem -
I was using android.support.constraint.ConstraintLayout that's why it was saying "Problem loading widget" after removing this and changing to LinearLayout problem solved as @Gangnus saying, it will work for only specific views only.
It may be caused by Moving of the specific (Widget) Application from Internal Memory to SD card
.(Android – Fixing “Problem Loading Widget” Error)
Basically Widgets swallow exceptions. Just set an appropriate filter in your logcat, and you'll be able to see what the problem is...
Above, I am just searching for the Word "Widget" and setting no filter on any specific application. It essentially gives me the Throwable.getMessage()
without the full stack trace.
There is of course the use-case where there was a widget loaded on the home page and the user then uninstalls the application that contains the widget and widget config app.
When that happens, all you see is the "Problem Loading Widget" in a toast-like box on the home screen. As far as I can tell, the widget gets no indicatation that the package is being uninstalled and I guess then the home screen AppWidgetManager thows up a default message.
Not well thought out behaviour on the part of the OS team. I suggest that it would be better to call the widget's onDisbled() and onDestroy() methods before the package is removed so they can tidy up if need be and the user (non-geek phone user) gets a clean experience.
I had the same issue. Problem resolved: I used custom view in widget. In my situation it was TextView with custom typeface.