Ich habe einen animierten Vektor von https://romannurik.github.io/AndroidIconAnimator/ exportieren.Android animierte Vektor in einer Datei Kompilierungsfehler
die erzeugte Datei ist
<animated-vector
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:width="510dp"
android:height="510dp"
android:viewportWidth="510"
android:viewportHeight="510"
android:alpha="1">
<group android:name="group">
<group android:name="play_circle_outline">
<path
android:name="path"
android:pathData="M 204 369.75 L 357 255 L 204 140.25 L 204 369.75 Z M 255 0 C 114.75 0 0 114.75 0 255 C 0 395.25 114.75 510 255 510 C 395.25 510 510 395.25 510 255 C 510 114.75 395.25 0 255 0 Z M 255 459 C 142.8 459 51 367.2 51 255 C 51 142.8 142.8 51 255 51 C 367.2 51 459 142.8 459 255 C 459 367.2 367.2 459 255 459 Z"
android:strokeColor="#000000"/>
</group>
</group>
</vector>
</aapt:attr>
<target android:name="path">
<aapt:attr name="android:animation">
<objectAnimator
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="path"
android:propertyName="pathData"
android:startOffset="200"
android:duration="1000"
android:valueFrom="M 204 369.75 L 357 255 L 204 140.25 L 204 369.75 Z M 255 0 C 114.75 0 0 114.75 0 255 C 0 395.25 114.75 510 255 510 C 395.25 510 510 395.25 510 255 C 510 114.75 395.25 0 255 0 Z M 255 459 C 142.8 459 51 367.2 51 255 C 51 142.8 142.8 51 255 51 C 367.2 51 459 142.8 459 255 C 459 367.2 367.2 459 255 459 Z"
android:valueTo="M 204 369.75 L 360 180 L 204 369.75 L 150 336.75 Z M 255 0 C 114.75 0 0 114.75 0 255 C 0 395.25 114.75 510 255 510 C 395.25 510 510 395.25 510 255 C 510 114.75 395.25 0 255 0 Z M 255 459 C 142.8 459 51 367.2 51 255 C 51 142.8 142.8 51 255 51 C 367.2 51 459 142.8 459 255 C 459 367.2 367.2 459 255 459 Z"
android:valueType="pathType"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"/>
</aapt:attr>
</target>
</animated-vector>
Aber es mehrere Fehler geben, wenn im die Datei im Android Studio hinzufügen.
erster Fehler ist: Element animierte Vektor nicht erforderlich attrbute android: Zeichen. Zweiter Fehler in Zeile 4:
Attribut wird den Android-Namespacepräfix
fehlt und Online-22 Animation Attribut definiert werden soll.
Warum treten diese Fehler auf?
Ich habe https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html gesehen und hier ist die Datei mit einem Teil fast gleich.