pedant / sweet-alert-dialog

SweetAlert for Android, a beautiful and clever alert dialog
http://pedant.github.io
7.27k stars 1.94k forks source link

proguard error #49

Open JokerHYC opened 9 years ago

JokerHYC commented 9 years ago

java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error: [class android.content.Context, interface android.util.AttributeSet] at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:77) at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:64) at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:41) at cn.pedant.SweetAlert.OptAnimationLoader.a(OptAnimationLoader.java:22) at cn.pedant.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:80)

snakemouse3d commented 9 years ago

try to add this line to your proguard file: -keep class cn.pedant.SweetAlert.* { ; }

maobon commented 9 years ago

same wrong?why??? use that demo build jar file, and copy all res file into my project, finally add that jar file. run! java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:

JokerHYC commented 9 years ago

i solved this error by modify the source code the mothod createAnimationFromXml from Class OptAnimationLoader add } else if (name.equals("YOURPATH.Rotate3dAnimation")) { anim = new Rotate3dAnimation(c, attrs); } problem solved...

maobon commented 9 years ago

Thanks a lot! SweetAlert needs Materialish_progress, so I download another open source project. add them all...solved....

Tesvia commented 8 years ago

I've got the same issue. I didn't understand if the solution is just to add the line -keep class cn.pedant.SweetAlert.* { ; } to the proguard file. Can someone help? Thanks

RishabJaiswal commented 7 years ago

Instead of adding the library as a dependency in gradle file.

  1. imported the library as a gradle module in my project, Rename it as 'sweetalert' or whatever u like.

  2. then in mothod createAnimationFromXml of Class OptAnimationLoader add else if (name.equals("Rotate3dAnimation")) { anim = new Rotate3dAnimation(c, attrs); } as told above by @JokerHYC

3.include module dependency in app's module as compile project(':sweetalert')

Voila! That's it.

sonwani237 commented 6 years ago

use it -keep class cn.pedant.SweetAlert.Rotate3dAnimation { public (...); }