Hojjat Mehri Hojjat Mehri - 1 year ago 387
Android Question

Android studio building signed APK error on "Type of anim"

I trying to build singed apk with Android Studio.

when i press button to create signed apk i get this error :

Error: Expected resource of type anim [ResourceType]

And this line of my java code show's up

LayoutAnimationController lac = new LayoutAnimationController(AnimationUtils.loadAnimation(Employment.this,
R.animator.grow_from_bottom), 0.8f);

I do'nt have any problem to create Unsigned apk. just in singed apk.

Please help me.

thank you.

Answer Source

There are actually two different types of animations in Android: Animation and Animator. Likewise, there are two resource folders for each: res/anim and res/animator.

AnimationUtils works with Animation, but you're passing it an Animator, which is why it's getting upset. You need to give it an Animation resource (i.e. from R.anim).

Since it'll be important to learn the difference between the two types of animation, here are some resources: