Android vector drawable animation with keyframes
<p>I am trying to create a morph animation of a vector drawable, which looks like the gif below.</p>

<p><a href="https://i.stack.imgur.com/Nxxup.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/Nxxup.gif" alt="enter image description here"></a></p>

<p>This is all of the code for the animation.</p>

<p>vector.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
&lt;vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="30dp"
    android:width="66dp"
    android:viewportHeight="300"
    android:viewportWidth="660" &gt;
&lt;path
   android:fillColor="#444444"
   android:pathData="@string/leftcircle"/&gt;
&lt;path
   android:fillColor="#444444"
   android:pathData="@string/rightcircle"/&gt;
&lt;path
     android:name="v"
     android:fillColor="#888888"
     android:pathData="@string/path1" /&gt;
&lt;/vector&gt;
</code></pre>

<p>animated_vector.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;animated-vector xmlns:android="http://schemas.android.com/apk/res/android" 
android:drawable="@drawable/vector" &gt;
&lt;target
   android:name="v"
   android:animation="@anim/path_morph" /&gt;
&lt;/animated-vector&gt;
</code></pre>

<p>path_morph.xml</p>

<pre><code>&lt;objectAnimator
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:repeatCount="1"
android:repeatMode="reverse"&gt;
&lt;propertyValuesHolder
  android:valueType="pathType"
  android:propertyName="pathData"&gt;
  &lt;keyframe android:fraction="0" android:value="@string/path1"/&gt;
  &lt;keyframe android:fraction=".25" android:value="@string/path2"/&gt;
  &lt;keyframe android:fraction=".50" android:value="@string/path3"/&gt;
  &lt;keyframe android:fraction=".75" android:value="@string/path4"/&gt;
  &lt;keyframe android:fraction="1" android:value="@string/path5"/&gt;
&lt;/propertyValuesHolder&gt;
&lt;/objectAnimator&gt;
</code></pre>

<p>Also here is the path data in strings.xml.</p>

<pre><code>&lt;string name ="path1"&gt;M 270,150 C 270,187.37906 252.90964,220.76644 226.11667,242.77442 205.40491,259.78723 178.89511,270 150,270 121.84725,270 95.958829,260.30526 75.491116,244.07216 47.775945,222.09105 30,188.12142 30,150 30,111.70527 47.937943,77.600165 75.869739,55.628783 96.277661,39.575743 122.02056,30 150,30 178.97201,30 205.54599,40.267195 226.2819,57.361549 252.97988,79.370941 270,112.69784 270,150 Z&lt;/string&gt;
&lt;string name ="path2"&gt;M 270,150 C 270,187.37906 252.90964,220.76644 226.11667,242.77442 205.40491,259.78723 178.89511,270 150,270 121.84725,270 95.958829,260.30526 75.491116,244.07216 47.775945,222.09105 30,188.12142 30,150 30,111.70527 47.937943,77.600165 75.869739,55.628783 96.277661,39.575743 122.02056,30 150,30 178.97201,30 205.54599,40.267195 226.2819,57.361549 252.97988,79.370941 270,112.69784 270,150 Z&lt;/string&gt;
&lt;string name ="path3"&gt;M 452.83762,150 C 452.83762,205.05673 340.91918,223.02696 310.46441,229.64243 284.27202,235.33202 269.20391,236.28506 240.40866,238.68527 210.11173,241.21065 183.84211,242.12251 161.35408,230.4351 129.96629,214.12233 112.83251,188.6265 112.83251,150.50508 112.83251,112.21035 128.068,86.448772 159.7124,70.275994 186.18123,56.748335 210.11173,59.294424 245.45942,61.314729 274.38422,62.967933 284.69637,65.170902 311.13471,69.988456 344.39869,76.049765 452.83762,90.474484 452.83762,150 Z&lt;/string&gt;
&lt;string name ="path4"&gt;M 555.87318,152.52538 C 555.87318,207.58211 525.71582,219.24633 496.33248,230.14751 471.20294,239.47054 432.28759,238.60827 405.5686,236.66496 375.18319,234.45499 361.75301,231.64198 336.61554,228.41479 314.31913,225.55234 188.59395,188.6265 188.59395,150.50508 188.59395,112.21035 297.49736,79.662901 343.56017,71.286146 373.38379,65.86257 375.77674,65.35534 409.6092,62.829958 438.50083,60.673379 471.51631,62.981109 497.00278,71.503685 519.66016,79.080223 555.87318,92.999865 555.87318,152.52538 Z&lt;/string&gt;
&lt;string name ="path5"&gt;M 630,150 C 630,187.41085 612.88056,220.82323 586.04829,242.83055 565.34657,259.80969 538.86332,270 510,270 482.10724,270 456.43718,260.48349 436.05955,244.52022 408.01924,222.5542 390,188.38141 390,150 390,111.54658 408.08691,77.317584 436.21749,55.356271 456.56974,39.467432 482.17925,30 510,30 539.00418,30 565.60499,40.290006 586.35094,57.418512 613.00923,79.428421 630,112.73001 630,150 Z&lt;/string&gt;
</code></pre>

<p>So whatever I do, I can not make this work with keyframes. Either I get something like:</p>

<pre><code>Method set() with type float not found on target class class android.graphics.drawable.VectorDrawable$VFullPath
</code></pre>

<p>or nothing happens at all. I have tried using <code>&lt;animator/&gt; &lt;objectAnimator/&gt;</code> but the only thing that seems to work is executing animation set with delays for each <code>&lt;objectAnimator/&gt;</code>, which is how the animation from the gif was created. However this does not work for me since I want to be able to add an interpolator for the animation and be able to reverse it instead of fiddling with offsets and durations.</p>