Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daniel-waiguru opened this issue Sep 11, 2021 · 9 comments

Comments

@daniel-waiguru
Copy link

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
@arif-rahman-cse
Copy link

I am also getting the same error

@daniel-waiguru
Copy link
Author

daniel-waiguru commented Nov 6, 2021

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>

@100CPU
Copy link

100CPU commented Nov 28, 2021

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?

@daniel-waiguru
Copy link
Author

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

@100CPU
Copy link

100CPU commented Nov 29, 2021

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.

@daniel-waiguru
Copy link
Author

image

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

@rezaulkhan111
Copy link

rezaulkhan111 commented Mar 16, 2022

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

@Dave181295
Copy link

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?

@rezaulkhan111
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants