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

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

Closed
rahulrainaaa opened this issue Nov 14, 2017 · 19 comments
Closed

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

rahulrainaaa opened this issue Nov 14, 2017 · 19 comments

Comments

@rahulrainaaa
Copy link

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)

@RaminNikmanesh
Copy link

i have this error too

@msingh86
Copy link

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

@rahulrainaaa
Copy link
Author

capture

@lucianocheng
Copy link

lucianocheng commented Dec 21, 2017

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

@sljjyy
Copy link

sljjyy commented Feb 2, 2018

me too。。。。。。

@scdhao
Copy link

scdhao commented Feb 24, 2018

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

@imkobedroid
Copy link

Have I met the solution, too?

@ArslanKathia
Copy link

me too facing this issue..

@kkgowtham
Copy link

kkgowtham commented Aug 21, 2018

@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..

@MuhammedAlmaz
Copy link

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

@ashishnimrot
Copy link

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

@alirezaho2008
Copy link

just add this to proguard-rules.pro

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

@Amol-B-Patil
Copy link

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

@rahulrainaaa
Copy link
Author

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.

@rpurnama1409
Copy link

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

Solved this , thanks

@AustineGwa
Copy link

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

@thomper
Copy link

thomper commented Feb 8, 2021

@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

@AustineGwa
Copy link

@thomper Thanks will follow the other

@itsdani121
Copy link

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

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