Desktop Widgets have a limited set of allowed parts. The restrictions are necessary due to the potential security issues of allowing arbitrary code execution in the home screen.
Here's the relevant part of the appWidget Docs:
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
Descendants of these classes are not supported.