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

cn.pedant.SweetAlert.Rotate3dAnimation error:null --- Crashing

Open rahulrainaaa opened this issue 7 years ago • 19 comments

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.(SweetAlertDialog.java:80) at com.app.gofoodie.activity.derived.CartOrderActivity.menuProceed(CartOrderActivity.java:280) at com.app.gofoodie.activity.derived.CartOrderActivity.onOptionsItemSelected(CartOrderActivity.java:109) at android.app.Activity.onMenuItemSelected(Activity.java:3206) at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:360) at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:194) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:110) at android.support.v7.app.AppCompatDelegateImplV9.onMenuItemSelected(AppCompatDelegateImplV9.java:676) at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:821) at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:968) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958) at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:623) at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:147) at android.view.View.performClick(View.java:5675) at android.view.View$PerformClick.run(View.java:22646) at android.os.Handler.handleCallback(Handler.java:836) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6251) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

rahulrainaaa avatar Nov 14 '17 13:11 rahulrainaaa

i have this error too

RaminNikmanesh avatar Nov 15 '17 14:11 RaminNikmanesh

use this https://github.com/thomper/sweet-alert-dialog

msingh86 avatar Nov 16 '17 04:11 msingh86

capture

rahulrainaaa avatar Nov 16 '17 07:11 rahulrainaaa

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 !!).

lucianocheng avatar Dec 21 '17 20:12 lucianocheng

me too。。。。。。

sljjyy avatar Feb 02 '18 01:02 sljjyy

copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation

scdhao avatar Feb 24 '18 04:02 scdhao

Have I met the solution, too?

imkobedroid avatar Mar 16 '18 08:03 imkobedroid

me too facing this issue..

ArslanKathia avatar Jun 26 '18 08:06 ArslanKathia

@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 avatar Aug 21 '18 05:08 kkgowtham

@kkgowtham thank you sir , its worked for me too.

MuhammedAlmaz avatar Nov 05 '18 19:11 MuhammedAlmaz

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

ashishnimrot avatar Jan 07 '19 16:01 ashishnimrot

just add this to proguard-rules.pro

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

alirezaho2008 avatar Nov 10 '19 12:11 alirezaho2008

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.** { *; }

Amol-B-Patil avatar Dec 20 '19 10:12 Amol-B-Patil

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.** { *; }

This one is working perfectly fine. Applying the above mentioned proguard rule in project.

rahulrainaaa avatar May 15 '20 04:05 rahulrainaaa

copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation

Solved this , thanks

rpurnama1409 avatar Aug 02 '20 02:08 rpurnama1409

with already a working solution why can this not be added to the codebase of this library?

AustineGwa avatar Feb 07 '21 11:02 AustineGwa

@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 avatar Feb 08 '21 01:02 thomper

@thomper Thanks will follow the other

AustineGwa avatar Feb 08 '21 02:02 AustineGwa

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 !!).

how to move because in thompas git there is not implementation link

itsdani121 avatar Apr 20 '21 07:04 itsdani121