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

Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null #201

Open aichixiguaj opened 5 years ago

aichixiguaj commented 5 years ago

new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE) .setTitleText("Are you sure?") .setContentText("Won't be able to recover this file!") .setConfirmText("Yes,delete it!") .show(); 初始化时候报错

miladblg commented 5 years ago

you should add an animation file to anim folder of res and use below code:

error_frame_in.xml: <?xml version="1.0" encoding="utf-8"?>

<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"/>

kevinjam commented 4 years ago

you should add an animation file to anim folder of res and use below code:

error_frame_in.xml:

<alpha
    android:fromAlpha="0"
    android:toAlpha="1"
    android:duration="400"/>
This is working well in Android Studio 4.1 Canary 
Just add error_frame_in.xml inside anim as @miladblg suggested
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha
        android:fromAlpha="0"
        android:toAlpha="1"
        android:duration="400"/>
</set>
rscherf commented 3 years ago

I'm seeing this error again in Android Studio 4.1.3, with an error of:

Element sweet:cn.pedant.SweetAlert.Rotate3dAnimation is not allowed here

And the crash resolves as:

Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
Screen Shot 2021-03-19 at 8 02 50 AM