title: animated-vector-drawable API 16
body: <p>I'm trying to use com.android.support:support-vector-drawable:23.2.1, com.android.support:animated-vector-drawable:23.2.1 for API 16.
  <a href="http://android-developers.blogspot.ru/2016/02/android-support-library-232.html" rel="nofollow">Article</a>, I use Gradle Plugin 1.5.
  In API 23 it's works fine but for API 16 I have some errors:</p>
  
  <pre><code>04-10 12:32:24.097: E/dalvikvm(1039): Could not find class 'android.graphics.drawable.AnimatedVectorDrawable', referenced from method android.support.graphics.drawable.AnimatedVectorDrawableCompat.isRunning
  04-10 12:32:24.097: E/dalvikvm(1039): Could not find class 'android.graphics.drawable.AnimatedVectorDrawable', referenced from method android.support.graphics.drawable.AnimatedVectorDrawableCompat.start
  04-10 12:32:24.097: E/dalvikvm(1039): Could not find class 'android.graphics.drawable.AnimatedVectorDrawable', referenced from method android.support.graphics.drawable.AnimatedVectorDrawableCompat.stop
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039): Exception while inflating &lt;animated-vector&gt;
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039): java.lang.NumberFormatException: Invalid int: "M300,70 l 0,-70 70,70 0,0   -70,70z"
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at java.lang.Integer.invalidInt(Integer.java:138)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at java.lang.Integer.parse(Integer.java:375)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at java.lang.Integer.parseInt(Integer.java:366)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:123)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.content.res.TypedArray.getInt(TypedArray.java:254)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.loadAnimator(AnimatorInflater.java:258)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.loadObjectAnimator(AnimatorInflater.java:161)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:117)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:126)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.animation.AnimatorInflater.loadAnimator(AnimatorInflater.java:72)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.graphics.drawable.AnimatedVectorDrawableCompat.inflate(AnimatedVectorDrawableCompat.java:377)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.graphics.drawable.AnimatedVectorDrawableCompat.createFromXmlInner(AnimatedVectorDrawableCompat.java:162)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatDrawableManager$AvdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:865)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:320)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:49)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:65)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:53)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:972)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:1031)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at s99.vectoranimationtest.MainActivity.onCreate(MainActivity.java:16)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.Activity.performCreate(Activity.java:5008)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.ActivityThread.access$600(ActivityThread.java:130)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.os.Handler.dispatchMessage(Handler.java:99)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.os.Looper.loop(Looper.java:137)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at android.app.ActivityThread.main(ActivityThread.java:4745)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at java.lang.reflect.Method.invokeNative(Native Method)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at java.lang.reflect.Method.invoke(Method.java:511)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  04-10 12:32:24.101: E/AvdcInflateDelegate(1039):    at dalvik.system.NativeStart.main(Native Method)
  04-10 12:32:24.101: E/AndroidRuntime(1039): FATAL EXCEPTION: main
  04-10 12:32:24.101: E/AndroidRuntime(1039): java.lang.RuntimeException: Unable to start activity ComponentInfo{s99.vectoranimationtest/s99.vectoranimationtest.MainActivity}: android.view.InflateException: Binary XML file line #19: Error inflating class ImageView
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.os.Handler.dispatchMessage(Handler.java:99)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.os.Looper.loop(Looper.java:137)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread.main(ActivityThread.java:4745)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at java.lang.reflect.Method.invoke(Method.java:511)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at dalvik.system.NativeStart.main(Native Method)
  04-10 12:32:24.101: E/AndroidRuntime(1039): Caused by: android.view.InflateException: Binary XML file line #19: Error inflating class ImageView
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:276)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at s99.vectoranimationtest.MainActivity.onCreate(MainActivity.java:16)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.Activity.performCreate(Activity.java:5008)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     ... 11 more
  04-10 12:32:24.101: E/AndroidRuntime(1039): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/avd.xml from drawable resource ID #0x7f02004b
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.content.res.Resources.loadDrawable(Resources.java:1918)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.content.res.Resources.getDrawable(Resources.java:659)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.TintResources.superGetDrawable(TintResources.java:55)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatDrawableManager.onDrawableLoadedFromResources(AppCompatDrawableManager.java:391)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.TintResources.getDrawable(TintResources.java:48)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:323)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatImageHelper.loadFromAttributes(AppCompatImageHelper.java:49)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:65)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.widget.AppCompatImageView.&lt;init&gt;(AppCompatImageView.java:53)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:972)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:1031)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     ... 21 more
  04-10 12:32:24.101: E/AndroidRuntime(1039): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: invalid drawable tag animated-vector
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     at android.content.res.Resources.loadDrawable(Resources.java:1915)
  04-10 12:32:24.101: E/AndroidRuntime(1039):     ... 36 more
  </code></pre>
  
  <p>ImageView:</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/text_view"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerVertical="true"
      android:layout_centerHorizontal="true"
      app:srcCompat="@drawable/avd"/&gt;
  </code></pre>
  
  <p>avd.xml:</p>
  
  <pre><code>&lt;animated-vector
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:drawable="@drawable/vectordrawable"
      tools:ignore="NewApi"&gt;
      &lt;target
          android:name="rotationGroup"
          android:animation="@anim/rotation" /&gt;
      &lt;target
          android:name="v"
          android:animation="@anim/path_morph" /&gt;
  &lt;/animated-vector&gt;
  </code></pre>
  
  <p>vectordrawable.xml:</p>
  
  <pre><code>&lt;vector
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:height="64dp"
      android:width="64dp"
      android:viewportHeight="600"
      android:viewportWidth="600" &gt;
      &lt;group
          android:name="rotationGroup"
          android:pivotX="300.0"
          android:pivotY="300.0"
          android:rotation="45.0" &gt;
          &lt;path
              android:name="v"
              android:fillColor="#000000"
              android:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" /&gt;
      &lt;/group&gt;
  &lt;/vector&gt;
  </code></pre>
  
  <p>rotation.xml:</p>
  
  <pre><code>&lt;objectAnimator
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:duration="6000"
      android:propertyName="rotation"
      android:valueFrom="0"
      android:valueTo="360" /&gt;
  </code></pre>
  
  <p>path_morph.xml:</p>
  
  <pre><code>&lt;set
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;objectAnimator
          android:duration="3000"
          android:propertyName="pathData"
          android:valueFrom="M300,70 l 0,-70 70,70 0,0   -70,70z"
          android:valueTo="M300,70 l 0,-70 70,0  0,140 -70,0 z"
          android:valueType="pathType"/&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>start animation:</p>
  
  <pre><code>ImageView textView = (ImageView) findViewById(R.id.text_view);
  Drawable drawable = textView.getDrawable();
  if (drawable instanceof AnimatedVectorDrawableCompat) {
      ((AnimatedVectorDrawableCompat) drawable).start();
  }
  </code></pre>
  
  <p>build.gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.3"
  
      defaultConfig {
          applicationId "s99.vectoranimationtest"
          minSdkVersion 16
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
          generatedDensities = []
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      aaptOptions {
          additionalParameters "--no-version-vectors"
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:23.2.1'
      compile 'com.android.support:support-vector-drawable:23.2.1'
      compile 'com.android.support:animated-vector-drawable:23.2.1'
  }
  </code></pre>