sweet-alert-dialog icon indicating copy to clipboard operation
sweet-alert-dialog copied to clipboard

Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation

Open daniel-waiguru opened this issue 3 years ago • 9 comments

Getting this error after enabling obfuscation, here is a full stack trace

2021-09-11 23:36:45.152 10096-10096/<packagename> E/AndroidRuntime: FATAL EXCEPTION: main
    Process: <packagename>, PID: 10096
    java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
        at a2.b.b(:83)
        at a2.b.b(:65)
        at a2.b.a(:41)
        at a2.b.c(:22)
        at a2.k.<init>(:125)
        at androidx.fragment.app.Fragment.n1(:2987)
        at androidx.fragment.app.t.f(:546)
        at androidx.fragment.app.t.m(:282)
        at androidx.fragment.app.m.d0(:2189)
        at androidx.fragment.app.m.a1(:2106)
        at androidx.fragment.app.m.a0(:2002)
        at androidx.fragment.app.m$g.run(:524)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:251)
        at android.app.ActivityThread.main(ActivityThread.java:7465)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)

Tried adding the following rules to my proguard-rules.pro file but the error still persists

keep class cn.pedant.** { *; }
-keep class cn.pedant.SweetAlert.Rotate3dAnimation {
    public <init>(...);
 }
-keep class cn.pedant.SweetAlert.Rotate3dAnimation

daniel-waiguru avatar Sep 11 '21 20:09 daniel-waiguru

I am also getting the same error

arif-rahman-cse avatar Oct 23 '21 07:10 arif-rahman-cse

Got a solution Create a file named error_frame_in.xml in your anim folder and add the following content.

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha android:fromAlpha="0"
        android:toAlpha="1"
        android:duration= "400"
        />
</set>

daniel-waiguru avatar Nov 06 '21 13:11 daniel-waiguru

I am also getting the same error. What do mean by "anim folder". Where should it be? I use this lib within a mobile app. Where should this xml be stored in this case?

100CPU avatar Nov 28 '21 12:11 100CPU

I am also getting the same error. What do mean by "anim folder". Where should it be? I use this lib within a mobile app. Where should this xml be stored in this case?

the anim folder means animation folder, can be found in res-resource directory

daniel-waiguru avatar Nov 28 '21 21:11 daniel-waiguru

I have no animation folder or something like that. Can the above XML entry be in any folder? For example I have a folder called XML in which I set general settings.

100CPU avatar Nov 29 '21 16:11 100CPU

image The animation folder is created when you create an animation file normally in anim folder is where all the animations files reside

daniel-waiguru avatar Dec 18 '21 15:12 daniel-waiguru

when app publishes as release mode. inside the 'OptAnimationLoader' class> 'createAnimationFromXml' method> default case ' throw RuntimeException'. I just replace RuntimeException with a break. (library tries to dynamically choose the constructor). image

rezaulkhan111 avatar Mar 16 '22 07:03 rezaulkhan111

when app publishes as release mode. inside the 'OptAnimationLoader' class> 'createAnimationFromXml' method> default case ' throw RuntimeException'. I just replace RuntimeException with a break. (library tries to dynamically choose the constructor). image

Nice, but file is read only, how can you modify it?

Dave181295 avatar Apr 01 '22 11:04 Dave181295

when app publishes as release mode. inside the 'OptAnimationLoader' class> 'createAnimationFromXml' method> default case ' throw RuntimeException'. I just replace RuntimeException with a break. (library tries to dynamically choose the constructor). image

Nice, but file is read only, how can you modify it?

I downloaded the source code then modified it

rezaulkhan111 avatar Apr 01 '22 11:04 rezaulkhan111