"_Problem Loading Widget" message

As said in comments, check logcat. What you will see is a NullPointerException. I have had this before too.


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:

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • GridLayout

And the following widget classes:

  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ImageView
  • ProgressBar
  • TextView
  • ViewFlipper
  • ListView
  • GridView
  • StackView
  • AdapterViewFlipper

Using forbidden elements causes this very

Problem Loading Widget

message, without saying where did it happen.

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"