sweet-alert-dialog icon indicating copy to clipboard operation
sweet-alert-dialog copied to clipboard

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

Open afinal opened this issue 7 years ago • 27 comments

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

afinal avatar Aug 15 '17 02:08 afinal

You should add this to proguard

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

bazimogmbh avatar Aug 15 '17 22:08 bazimogmbh

I try the sample,when I change sample's library like this dependencies { compile 'cn.pedant.sweetalert:library:1.3' // compile project(':library') }

get the same error ,so i think it's not proguard problem

afinal avatar Aug 16 '17 09:08 afinal

now i use library from github, not use compile 'cn.pedant.sweetalert:library:1.3'

my problem solved

afinal avatar Aug 16 '17 09:08 afinal

Any solution for this issue?

mansoorahmadsamar avatar Aug 21 '17 08:08 mansoorahmadsamar

@mansoorahmadsamar download library for using

afinal avatar Aug 21 '17 08:08 afinal

Great, Thanks @afinal

mansoorahmadsamar avatar Aug 21 '17 08:08 mansoorahmadsamar

@mansoorahmadsamar You are welcome.

afinal avatar Aug 21 '17 08:08 afinal

can you ask you? you use develop tools is Android Studio3.0? and how reslove? help me @afinal ,you ues local library?

GHpeter avatar Aug 30 '17 14:08 GHpeter

solution: 1 download sc to lead. 2. configuration at proguard-rules.pro add this: -keep class cn.pedant.SweetAlert.Rotate3dAnimation { public <init>(...); } at project gradle.properties add this: VERSION_NAME=1.3 GROUP=cn.pedant.sweetalert POM_DESCRIPTION=SweetAlert for Android, a beautiful and clever alert dialog. POM_URL=https://github.com/pedant/sweet-alert-dialog POM_SCM_URL=https://github.com/pedant/sweet-alert-dialog POM_SCM_CONNECTION=scm:[email protected]:pedant/sweet-alert-dialog.git POM_SCM_DEV_CONNECTION=scm:[email protected]:pedant/sweet-alert-dialog.git POM_LICENCE_NAME=The MIT License POM_LICENCE_URL=http://opensource.org/licenses/MIT POM_LICENCE_DIST=repo POM_DEVELOPER_ID=pedant POM_DEVELOPER_NAME=Pedant

at libray build.gradle change code : compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion change it for your own project


Oh yeah and: Don't forget to dependencies { compile 'cn.pedant.sweetalert:library:1.3' // compile project(':library') } As well as <item name="android:windowEnterAnimation">@anim/dialogui_enter_center</item> You need to remove the @ from the source code

ga1ya avatar Sep 11 '17 12:09 ga1ya

@anim/dialogui_enter_center where is this one?

parvendan avatar Sep 18 '17 11:09 parvendan

works fine for old version , just back to classpath 'com.android.tools.build:gradle:2.3.3' and also ok with :library:1.3. hope this help :D

sitonthegold avatar Oct 01 '17 08:10 sitonthegold

I Found a solution , import lib as module

A7med7ani avatar Oct 26 '17 12:10 A7med7ani

How can I import it as module? I downloaded the .zip from the repo, but im stuck at this point. Can somebody help me pls?

ghost avatar Oct 27 '17 11:10 ghost

@GHpeter 我是把这个库克隆到本地,然后import as module

afinal avatar Oct 27 '17 11:10 afinal

@A7med7ani YES

afinal avatar Oct 27 '17 11:10 afinal

@zedz01 clone this repo, and import as module

afinal avatar Oct 27 '17 11:10 afinal

clone repo, then import library as module then copy

// VERSION_NAME=1.3 VERSION_CODE=4 GROUP=cn.pedant.sweetalert

POM_DESCRIPTION=SweetAlert for Android, a beautiful and clever alert dialog. POM_URL=https://github.com/pedant/sweet-alert-dialog POM_SCM_URL=https://github.com/pedant/sweet-alert-dialog POM_SCM_CONNECTION=scm:[email protected]:pedant/sweet-alert-dialog.git POM_SCM_DEV_CONNECTION=scm:[email protected]:pedant/sweet-alert-dialog.git POM_LICENCE_NAME=The MIT License POM_LICENCE_URL=http://opensource.org/licenses/MIT POM_LICENCE_DIST=repo POM_DEVELOPER_ID=pedant POM_DEVELOPER_NAME=Pedant

/// in gradle.properties file

and copy in build file

ext { compileSdkVersion = 25 buildToolsVersion = "3.0.0" }

A7med7ani avatar Oct 27 '17 11:10 A7med7ani

use this library is the same just with new features https://jitpack.io/p/Leogiroux/sweet-alert-dialog

EvilShok avatar Nov 10 '17 01:11 EvilShok

I use this link and that's work like a charm. https://jitpack.io/p/thomper/sweet-alert-dialog/v1.4.0

amadou009 avatar Nov 20 '17 21:11 amadou009

Between this last two @EvilShok and @amadou009 which one is the "correct"? I guess both are clones of this repo that is 3 years old? or??? it is best to go with the solution posted before https://github.com/pedant/sweet-alert-dialog/issues/148#issuecomment-339949086

tyoc213 avatar Nov 22 '17 04:11 tyoc213

@tyoc213 I didn't use #148 but mine work. So you can test them and do your choice. Good luck

amadou009 avatar Nov 23 '17 10:11 amadou009

hey guys all of you are here post their error mine also shows the same error but the question is do any one solve this issue if yes then give us solution

DeveloperAdam avatar Nov 24 '17 05:11 DeveloperAdam

Well the problem would be solved if @pedant where active, but he seem long gone this years... 😢 (see that there are like 16 pendings PR and the ones referenced are forks)... you should try any of them, for me it worked the first one didnt test the second, but I guess it will work too.

Both of them are forks of this repo by @pedant.

tyoc213 avatar Nov 24 '17 05:11 tyoc213

@EvilShok and @amadou009 both answers worked out.. Im using @amadou009 answer

RajeshNaddy avatar Nov 28 '17 07:11 RajeshNaddy

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

lucianocheng avatar Dec 21 '17 20:12 lucianocheng

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

ashishnimrot avatar Jan 07 '19 16:01 ashishnimrot

This Library is not maintained

To solve this issue

Modify the File OptAnimationLoader

Add another else condition / case

case "YOURPATH.Rotate3dAnimation":
                    anim = new Rotate3dAnimation(c, attrs);
                    break;

wilsonhub avatar Aug 27 '19 07:08 wilsonhub