sweet-alert-dialog
sweet-alert-dialog copied to clipboard
cn.pedant.SweetAlert.Rotate3dAnimation error:null --- Crashing
FATAL EXCEPTION: main
Process: com.app.gofoodie, PID: 4704
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
at cn.pedant.SweetAlert.SweetAlertDialog.
i have this error too
use this https://github.com/thomper/sweet-alert-dialog
BTW, for those still following this thread:
This is happening because it's failing to turn the 50%
string from pivotX
/ pivotY
into the integer '50', which it needs.
It's failing on this line in OptAnimationLoader.java
, specifically the call to .newInstance(c, attrs);
anim = (Animation) Class.forName(name).getConstructor(Context.class, AttributeSet.class).newInstance(c, attrs);
I forked the repo and changed 50%
to 50
and it worked. This is the error I was seeing:
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64)
at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41)
at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
For the record, this repo is unmaintained, and everyone should switch over to @thomper 's fork at https://github.com/pedant/sweet-alert-dialog/ which works perfectly (thanks @thomper !!).
me too。。。。。。
copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation
Have I met the solution, too?
me too facing this issue..
@scdhao It worked for me. 1)Copy the anim folder from library to your preoject in res folder. 2)Then remove this
<sweet:cn.pedant.SweetAlert.Rotate3dAnimation sweet:rollType="x" sweet:fromDeg="100" sweet:toDeg="0" sweet:pivotX="50%" sweet:pivotY="50%" android:duration="400"/>
from error_frame_in.xml
3)Rebuild the project and run..
@kkgowtham thank you sir , its worked for me too.
java.lang.RuntimeException appears in Android Studio 3.X using Sweet Alert Dialog: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error: null error
I read a lot of blogs on the Internet and said that using Sweet Alert Dialog has encountered similar problems. The solution is very strange. Some say that it is to download lib and import it into the project.
Some say it is a confusion problem, in fact, the solution is very simple, you can change the added dependency library.
Errored library, comment out
implementation 'cn.pedant.sweetalert:library:1.3'
Add the following library
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
Ok run again, problem solving
just add this to proguard-rules.pro
-keep class cn.pedant.SweetAlert.Rotate3dAnimation {
public <init>(...);
}
I got the solution!
if you are using implementation 'cn.pedant.sweetalert:library:1.3'
library, just add the below line in your proguard-rules.pro
file.
-keep class cn.pedant.** { *; }
I got the solution! if you are using
implementation 'cn.pedant.sweetalert:library:1.3'
library, just add the below line in yourproguard-rules.pro
file.
-keep class cn.pedant.** { *; }
This one is working perfectly fine. Applying the above mentioned proguard rule in project.
copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation
Solved this , thanks
with already a working solution why can this not be added to the codebase of this library?
@AustineGwa the maintainer, @pedant has been missing in action for a long time. I believe F0ris keeps his fork here up to date: https://github.com/F0RIS/sweet-alert-dialog
@thomper Thanks will follow the other
BTW, for those still following this thread:
This is happening because it's failing to turn the
50%
string frompivotX
/pivotY
into the integer '50', which it needs.It's failing on this line in
OptAnimationLoader.java
, specifically the call to.newInstance(c, attrs);
anim = (Animation) Class.forName(name).getConstructor(Context.class, AttributeSet.class).newInstance(c, attrs);
I forked the repo and changed
50%
to50
and it worked. This is the error I was seeing:java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:77) at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:64) at cn.pedant.SweetAlert.OptAnimationLoader.createAnimationFromXml(OptAnimationLoader.java:41) at cn.pedant.SweetAlert.OptAnimationLoader.loadAnimation(OptAnimationLoader.java:22)
For the record, this repo is unmaintained, and everyone should switch over to @thomper 's fork at https://github.com/pedant/sweet-alert-dialog/ which works perfectly (thanks @thomper !!).
how to move because in thompas git there is not implementation link