Skeleton-Bones
Skeleton-Bones copied to clipboard
Crash in release build due to missing proguard rules
Describe the bug Everything works fine when building directly from Android Studio, but as soon as we made a release build, we got a crash:
Fatal Exception: java.lang.IllegalArgumentException: The key must be an application-specific resource id. at android.view.View.setTag(View.java:26098) at com.eudycontreras.boneslibrary.extensions.ViewExtensionsKt.clearProps(ViewExtensionsKt.java:153) at com.eudycontreras.boneslibrary.framework.bones.BoneDrawable$initialize$4.invoke(BoneDrawable.kt:179) at com.eudycontreras.boneslibrary.framework.bones.BoneDrawable$initialize$4.invoke(BoneDrawable.kt:94) at com.eudycontreras.boneslibrary.framework.bones.BoneManager.dispose(BoneManager.kt:108) at com.eudycontreras.boneslibrary.framework.bones.BoneManager$animateFadeOut$3.invoke(BoneManager.kt:166) at com.eudycontreras.boneslibrary.framework.bones.BoneManager$animateFadeOut$3.invoke(BoneManager.kt:23) at com.eudycontreras.boneslibrary.extensions.AnimatorExtensionsKt$animate$$inlined$addListener$1.onAnimationEnd(Animator.kt:117) at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:600) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1333) at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1575) at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:307) at android.animation.AnimationHandler.-$$Nest$mdoAnimationFrame(AnimationHandler.java) at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:86) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239) at android.view.Choreographer.doCallbacks(Choreographer.java:899) at android.view.Choreographer.doFrame(Choreographer.java:827) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
We fixed this by adding the following line to our app's proguard-rules.pro:
-keep class com.eudycontreras.boneslibrary.framework.bones.BoneProperties { *; }
This was hard to debug, so it would be nice if this line was just added the the proguard-rules file in the library instead :)
Smartphone (please complete the following information):
- Device: Pixel 6
- SDK Version 33
- Version v1.4.5
I have same bug
The same crash if you are using SkeletonDrawable. Add to fix:
-keep class com.eudycontreras.boneslibrary.framework.skeletons.SkeletonProperties { *; }