title: How to make AppCompatImageView works in widget?
body: <p>I try to use AppCompatImageView to display a vector image in a widget, but image is not displayed (instead I got a cut message "Error loading..."). The same piece of code works well in my main activity (both are in LinearLayout). Is there a limitation for widgets ? What do I miss ?</p>
  
  <p>My minSdkVersion is 19, and I use androidx.</p>
  
  <p>I tried to change layout to a standard LinearLayout.</p>
  
  <p>My XML :</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;androidx.appcompat.widget.LinearLayoutCompat
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/widget_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@color/colorPrimaryDark"
      android:orientation="vertical"&gt;
  
      &lt;androidx.appcompat.widget.AppCompatImageView
          android:id="@+id/appwidget_image"
          android:layout_width="match_parent"
          android:layout_height="50dp"
          android:contentDescription="@+id/appwidget_label"
          android:padding="5dp"
          app:srcCompat="@drawable/ic_baseline_toggle_off_24px"
          android:tint="@color/colorAccent"/&gt;
  
      &lt;TextView
          android:id="@+id/appwidget_label"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:ellipsize="end"
          android:gravity="center_horizontal"
          android:paddingLeft="2dp"
          android:paddingRight="2dp"
          android:singleLine="true"
          android:text="@string/appwidget_default_text"
          android:textAlignment="gravity"
          android:textColor="@color/colorAccent"
          android:textSize="12sp" /&gt;
  
  &lt;/androidx.appcompat.widget.LinearLayoutCompat&gt;
  </code></pre>
  
  <p>Extract of my build.gradle :</p>
  
  <pre><code>android {
      compileSdkVersion 28
      defaultConfig {
          vectorDrawables.useSupportLibrary = true
      }
  }
  
  dependencies {
      implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
      implementation 'androidx.appcompat:appcompat-resources:1.1.0-alpha05'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
      implementation 'com.loopj.android:android-async-http:1.4.9'
      implementation 'com.squareup.okhttp3:okhttp:3.10.0'
      implementation 'de.greenrobot:eventbus:2.4.0'
      implementation 'com.j256.ormlite:ormlite-android:4.48'
      implementation 'androidx.work:work-runtime:2.0.1'
  }
  </code></pre>
  
  <p>Some messages in logcat I don't understand (but not necessary related to my problem) :</p>
  
  <pre><code>05-21 19:38:09.886 12404-12404/com.yadoms.widgets.statedisplay E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method androidx.appcompat.widget.AppCompatImageHelper.hasOverlappingRendering
  05-21 19:38:09.886 12404-12404/com.yadoms.widgets.statedisplay W/dalvikvm: VFY: unable to resolve instanceof 216 (Landroid/graphics/drawable/RippleDrawable;) in Landroidx/appcompat/widget/AppCompatImageHelper;
  
  05-21 19:38:09.906 12404-12404/com.yadoms.widgets.statedisplay E/dalvikvm: Could not find class 'android.view.textclassifier.TextClassificationManager', referenced from method androidx.appcompat.widget.AppCompatTextClassifierHelper.getTextClassifier
  
  05-21 19:38:10.066 12404-12404/com.yadoms.widgets.statedisplay E/EGL_emulation: tid 12404: eglSurfaceAttrib(1199): error 0x3009 (EGL_BAD_MATCH)
  </code></pre>
  
  <p>Thanks for your help</p>