SweetAlertDialog : Unknown animation name Rotate3dAnimation

Problem

When using sweetAlertDialog in higher targetSdkVersion(>=16) and above facing issue for SweetAlert library as,

java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null

Solution

Use latest sweetAlert package version in gradle.build file as,

    dependencies {
        implementation 'com.github.f0ris.sweetalert:library:1.5.6'
    }

But the after installation of the library in recent Android Studio versions with higher targetSdkVersion it will fail. So we need to add following rules in proguard-rules.pro file,

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

proguard-rules.pro

Uses

SweetAlert is the best and clever dialog used in android. Display different types of alert depends on response,

  • Success
  • Warning
  • Error
  • Information
  • Loading
  • Confirmation

Written by@Sandhya Deshmukh
Have a good experiance on Android in fintech, CRM domain. Also expert in React-Native, React