lottie-web: AVD export is crashing the app on Android API Level <21

loading_icon_animated.txt

Tell us about your environment

  • Phone Version: Android 19
  • After Effects Version: 14.2.1.34

What did you do? Please explain the steps you took before you encountered the problem. Just exporting a xml file with After Effects and trying to integrate it into an Android application.

What did you expect to happen? An animating vector drawable

What actually happened? Please include as much relevant detail as possible. Crash after the following line of code:

AnimatedVectorDrawableCompat animatedVectorDrawable = AnimatedVectorDrawableCompat.create(getContext(), R.drawable .loading_icon_animated);

Caused by: android.view.InflateException: pathInterpolator requires the controlX1 attribute at android.support.graphics.drawable.PathInterpolatorCompat.parseInterpolatorFromTypeArray(PathInterpolatorCompat.java:90) at android.support.graphics.drawable.PathInterpolatorCompat.<init>(PathInterpolatorCompat.java:72) at android.support.graphics.drawable.PathInterpolatorCompat.<init>(PathInterpolatorCompat.java:65) at android.support.graphics.drawable.AnimationUtilsCompat.createInterpolatorFromXml(AnimationUtilsCompat.java:140) at android.support.graphics.drawable.AnimationUtilsCompat.loadInterpolator(AnimationUtilsCompat.java:81) at android.support.graphics.drawable.AnimatorInflaterCompat.loadAnimator(AnimatorInflaterCompat.java:821) at android.support.graphics.drawable.AnimatorInflaterCompat.loadObjectAnimator(AnimatorInflaterCompat.java:790) at android.support.graphics.drawable.AnimatorInflaterCompat.createAnimatorFromXml(AnimatorInflaterCompat.java:443) at android.support.graphics.drawable.AnimatorInflaterCompat.createAnimatorFromXml(AnimatorInflaterCompat.java:454) at android.support.graphics.drawable.AnimatorInflaterCompat.createAnimatorFromXml(AnimatorInflaterCompat.java:417) at android.support.graphics.drawable.AnimatorInflaterCompat.loadAnimator(AnimatorInflaterCompat.java:126) at android.support.graphics.drawable.AnimatorInflaterCompat.loadAnimator(AnimatorInflaterCompat.java:113) at android.support.graphics.drawable.AnimatorInflaterCompat.loadAnimator(AnimatorInflaterCompat.java:96) at android.support.graphics.drawable.AnimatedVectorDrawableCompat.inflate(AnimatedVectorDrawableCompat.java:485) at android.support.graphics.drawable.AnimatedVectorDrawableCompat.createFromXmlInner(AnimatedVectorDrawableCompat.java:253) at android.support.graphics.drawable.AnimatedVectorDrawableCompat.create(AnimatedVectorDrawableCompat.java:233)

Please provide a download link to the After Effects file that demonstrates the problem. File attached

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18

Most upvoted comments

This is fixed in buildToolsVersion 27.0.1 🙌

@nickbutcher Narrowed this down a bit. Crash goes away (on my particular test file) if I remove:

                    <aapt:attr name="android:interpolator">
                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0"/>
                    </aapt:attr>

From:

                <objectAnimator
                    android:duration="667"
                    android:propertyName="trimPathStart"
                    android:startOffset="868"
                    android:valueFrom="0"
                    android:valueTo="1"
                    android:valueType="floatType">
                    <aapt:attr name="android:interpolator">
                        <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0 0.667,1 1.0,1.0"/>
                    </aapt:attr>
                </objectAnimator>

(Seems like AAPT2 doesn’t support <aapt:attr ...> inside <objectAnimator>...</objectAnimator>)

Sample files (one crashes, one doesn’t): https://gist.github.com/petedoyle/409998f898a277b83649d1293403ee77

Not sure if there are tags other than objectAnimator that might also be affected…

Edit: might be fixed in the next build tools? https://issuetracker.google.com/issues/67668749

@denghewenai as this sounds like an issue with AnimatedVectorDrawableCompat please can you file an issue with repro case at https://issuetracker.google.com/