sweet-alert-dialog
sweet-alert-dialog copied to clipboard
java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
Run Android Q throw the " java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null"
check this fork https://github.com/F0RIS/sweet-alert-dialog
This has appear again, even in the above fork, a year later. Any ideas?
Simple Solution:
- Create a "anim" folder under "res" folder
- Create xml file under "anim" folder and xml name must be "error_frame_in.xml"
- then paste this code
<set xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sweet="http://schemas.android.com/apk/res-auto" android:interpolator="@android:anim/linear_interpolator" android:shareInterpolator="true">
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="400"/>
<!--<sweet:cn.pedant.SweetAlert.Rotate3dAnimation
sweet:rollType="x"
sweet:fromDeg="100"
sweet:toDeg="0"
sweet:pivotX="50%"
sweet:pivotY="50%"
android:duration="400"/>-->
check this fork https://github.com/F0RIS/sweet-alert-dialog
work for me.
F0RIS fork worked! But @rajesh-karmaker's answer looks interesting too!
But @F0RIS, The buttons of the dialog are being cut off.
@F0RIS this worked for me thank you
Solución simple:
- Cree una carpeta "anim" en la carpeta "res"
- Cree un archivo xml en la carpeta "anim" y el nombre xml debe ser "error_frame_in.xml"
- luego pega este código
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="400"/> <!--<sweet:cn.pedant.SweetAlert.Rotate3dAnimation sweet:rollType="x" sweet:fromDeg="100" sweet:toDeg="0" sweet:pivotX="50%" sweet:pivotY="50%" android:duration="400"/>-->
@vsalguero
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). https://github.com/rezaulkhan111/sweet-alert-dialog