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
The problem on my side was that I used androidx.appcompat.widget.AppCompatTextView instead of TextView. So no AppCompat widgets in Widget layout. It seems that the Android Widget is so limited.
Check elements you used in the view in a Widget..
Documentation link
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
And the following widget classes:
Using forbidden elements causes this very
In my case I had a floating textView
over other views. Removing it and thinking of a different way of showing my info to the user with the existing views that are not overlapping was the solution.
So don't overlap views with RelativeLayout
, I still use it and it works, but the views are not overlapping as much as possible.
I faced this problem because I was trying to use Check-box!
So,just remove checkbox
.
it will work fine.
I had the same issue but the logcat did not show anything suspicious, neither an error nor a warning. Basically, I was calling a wrong method to change the color of the textview's text.
Just fixed another variant of this error not mentioned in the other answers.
Symptoms were: 1) "Problem loading widget" error on Gingerbread and below 2) The exact same build ran fine on ICS and Jellybean 3) No errors in logcat
The problem was caused by manipulating a view that was never inflated in the remoteviews. Specifically:
remoteviews.setViewVisibility(viewId, View.GONE);
Where viewId was a valid resource, but it was in a layout that was never added to the remote views. No errors were thrown, and the widget displayed 'Problem loading widget' after the call to .updateAppWidget()