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

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

Open afinal opened 7 years ago

afinal commented 7 years ago

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

bazimogmbh commented 7 years ago

You should add this to proguard

 -keep class cn.pedant.SweetAlert.Rotate3dAnimation {
    public <init>(...);
 }
afinal commented 7 years ago

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 commented 7 years ago

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

my problem solved

mansoorahmadsamar commented 7 years ago

Any solution for this issue?

afinal commented 7 years ago

@mansoorahmadsamar download library for using

mansoorahmadsamar commented 7 years ago

Great, Thanks @afinal

afinal commented 7 years ago

@mansoorahmadsamar You are welcome.

GHpeter commented 7 years ago

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

ga1ya commented 7 years ago

solution: 1 download sc to lead.

  1. 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:git@github.com:pedant/sweet-alert-dialog.git POM_SCM_DEV_CONNECTION=scm:git@github.com: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

parvendan commented 7 years ago
@anim/dialogui_enter_center where is this one?
sitonthegold commented 7 years ago

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

A7med7ani commented 6 years ago

I Found a solution , import lib as module

ghost commented 6 years ago

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?

afinal commented 6 years ago

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

afinal commented 6 years ago

@A7med7ani YES

afinal commented 6 years ago

@zedz01 clone this repo, and import as module

A7med7ani commented 6 years ago

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:git@github.com:pedant/sweet-alert-dialog.git POM_SCM_DEV_CONNECTION=scm:git@github.com: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" }

EvilShok commented 6 years ago

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

amadou009 commented 6 years ago

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

tyoc213 commented 6 years ago

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

amadou009 commented 6 years ago

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

DeveloperAdam commented 6 years ago

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

tyoc213 commented 6 years ago

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.

RajeshNaddy commented 6 years ago

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

lucianocheng commented 6 years ago

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

ashishnimrot commented 5 years ago

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

wilsonhub commented 5 years ago

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;