Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:nul #136

Open
lan5572 opened this issue May 27, 2017 · 45 comments

Comments

@lan5572
Copy link

lan5572 commented May 27, 2017

Caused by: 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)
at cn.pedant.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:80)
at com.commom.library.BaseActivity.showProgressDialog(BaseActivity.java:203)
at manage.o2o.sporch.com.seller.SellerLoginActivity$6.call(SellerLoginActivity.java:171)
at rx.internal.operators.OperatorDoOnSubscribe.call(OperatorDoOnSubscribe.java:40)
at rx.internal.operators.OperatorDoOnSubscribe.call(OperatorDoOnSubscribe.java:27)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:44)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:10142)
at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
at rx.android.schedulers.LooperScheduler$ScheduledAction.run(LooperScheduler.java:107)
at android.os.Handler.handleCallback(Handler.java:815) 
at android.os.Handler.dispatchMessage(Handler.java:104) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5905) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) 
Caused by: 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)
at cn.pedant.SweetAlert.SweetAlertDialog.(SweetAlertDialog.java:80)
at com.commom.library.BaseActivity.showErrorDialog(BaseActivity.java:235)
at com.commom.library.BaseActivity.loginOutByException(BaseActivity.java:278)
at com.commom.library.BaseActivity$1.call(BaseActivity.java:258)
at com.commom.library.BaseActivity$1.call(BaseActi

@gsteigert
Copy link

Facing the same issue here. I managed to fix it by cloning the repo and using it as a module in my project, rather than using the Maven artifact.

@sametbars
Copy link

sametbars commented Jun 2, 2017

Same error after upgrading gradle plugin version to "com.android.tools.build:gradle:3.0.0-alpha2", alpha1 was fine. I don't know if this upgrade can cause such things but I did not change anything else.

EDIT: proguard is disabled

@Nishant-Pathak
Copy link

Nishant-Pathak commented Jun 5, 2017

refer #6

@gsteigert
Copy link

@Nishant-Pathak In my case it wasn't a proguard issue, since proguard is disabled in my project. I started facing this issue when updating to build plugin "com.android.tools.build:gradle:3.0.0-alpha2". More specifically, the animation couldn't be loaded because when parsing a custom XML attribute, the value of other attribute was being returned, throwing a number conversion exception.

@prokash-sarkar
Copy link

'com.android.tools.build:gradle:3.0.0-alpha4' also has the same issue. A better workaround would be going back to ' classpath 'com.android.tools.build:gradle:3.0.0-alpha1'

@ogasimli
Copy link

I have the same issue after upgrading to 3.0.0-alpha2 plugin version.

@spurts51
Copy link

yes I also got the same issue this library doesn't supports the canary versions... I guess...

@omeramiel
Copy link

I tried to add this:
else if (name.equals("cn.pedant.SweetAlert.Rotate3dAnimation")) { anim = new Rotate3dAnimation(c, attrs); }

and it passed.
but it crashed afterwards with:

07-18 17:13:34.751 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.multlock.ekeys, PID: 17586
java.lang.NumberFormatException: Invalid float: "50.0%"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.initialParse(StringToReal.java:164)
at java.lang.StringToReal.parseFloat(StringToReal.java:323)
at java.lang.Float.parseFloat(Float.java:306)
at android.content.res.TypedArray.getFloat(TypedArray.java:359)
at cn.pedant.SweetAlert.Rotate3dAnimation.(Rotate3dAnimation.java:69)

@khoatd92
Copy link

khoatd92 commented Aug 3, 2017

I got the same issue when using com.android.tools.build:gradle:3.0.0-alpha9 . Any solution for that?

@khoatd92
Copy link

khoatd92 commented Aug 3, 2017

Look like @pedant don't maintain this project anymore. :(

@haoweizero
Copy link

o(╥﹏╥)o

@khoatd92
Copy link

khoatd92 commented Aug 7, 2017

btw, I already downloaded source code and import as a library and it works fine. No more error.

@pcg92
Copy link

pcg92 commented Aug 19, 2017

+1

@KeyurKba
Copy link

KeyurKba commented Aug 29, 2017

I have same issue with com.android.tools.build:gradle:3.0.0-beta2, and com.android.tools.build:gradle:3.0.0-beta3. can anyone solve this issue?

@KD-Dhiren
Copy link

KD-Dhiren commented Aug 29, 2017

I face the same issue when using "com.android.tools.build:gradle:3.0.0-beta3"
how to resolve this problem?
if it's not able to fixable, then I may remove this sweet-alert dialog library. and go with simple one.

@ga1ya
Copy link

ga1ya commented Sep 11, 2017

i tried everthing... include download sc.. add proguard .. not be solved

@ga1ya
Copy link

ga1ya commented Sep 11, 2017

@cjztool 你是下载了源码,如何配置的呢?求教

@lacuz
Copy link

lacuz commented Sep 13, 2017

abandon this library immediatly

@ivzb
Copy link

ivzb commented Sep 25, 2017

@lacuz suggest another library

@sitonthegold
Copy link

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

@ivzb
Copy link

ivzb commented Oct 1, 2017

@sitonthegold this is not a good option :)

@sitonthegold
Copy link

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

@ivzb try to keep class work for me.

@pcg92
Copy link

pcg92 commented Oct 17, 2017

it can be closed

@francescogatto
Copy link

Hi, when i import library folder, AS3 give me errors on this lines of the gradle library

`version = VERSION_NAME
group = GROUP

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion`

@pcg92
Copy link

pcg92 commented Oct 26, 2017

@francescogatto
You can delete version = VERSION_NAME
group = GROUP

and replace
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion`

for your gradle app version, for example in my case:
compileSdkVersion 26
buildToolsVersion "26.0.2"

@francescogatto
Copy link

thx @pcegarra but after you suggestion i'm having this error

Error:Could not get unknown property 'GROUP' for object of type org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer.

@pcg92
Copy link

pcg92 commented Oct 26, 2017

@francescogatto find and remove all the errors xD

@francescogatto
Copy link

right.. just remove apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' thx! :)

@wazzah-marham
Copy link

@francescogatto I am having the same issue, can you please help ? I have removed apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' but the error is still there

@pcg92
Copy link

pcg92 commented Oct 30, 2017

@wazzah-marham #136 (comment)
change your compile version and remove some maven dependencies

@shylendramadda
Copy link

Me too faced similar issue when I upgraded gradle 3.0.0 any solution for this?

@anisha219
Copy link

anisha219 commented Nov 1, 2017

download library from https://github.com/pedant/sweet-alert-dialog, and import library as module dependency, remove Gradle dependency (compile 'cn.pedant.sweetalert:library:1.3'). it will work.

@shylendramadda

@steven123151988
Copy link

这个怎么搞的 刚升级3.0.0就出现了。现在要返回2.3.3显然是不可能。

@thomper
Copy link

thomper commented Nov 13, 2017

If you don't want to download it and add it as a module dependency, I've forked this repo and updated it to work with the latest gradle and the latest version of the library materialish-progress.

To use it, you need to ensure you have jitpack.io in your gradle.build repositories (see https://jitpack.io) then change the compile line to:

compile 'com.github.thomper:sweet-alert-dialog:v1.4.0'

I moved the package in my fork so as not to step on pedant's toes if they decide to come back. It's under com.ontbee.legacyforks.cn.pedant.SweetAlert now so you'll need to change your import statements too to use this fork.

@SetareMaghari
Copy link

@thomper but it says:
Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.github.thomper:sweet-alert-dialog:v1.4.0.

@thomper
Copy link

thomper commented Nov 20, 2017

@SetareMaghari I haven't got time to troubleshoot this for you, it's working on my end. Have you added jitpack to the correct build.gradle section? See: https://jitpack.io/p/thomper/sweet-alert-dialog/v1.4.0

@AmalH
Copy link

AmalH commented Nov 29, 2017

@thomper thanks u're saving us time here !

@lucianocheng
Copy link

lucianocheng commented Dec 21, 2017

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

@jumaallan
Copy link

Just use this solution from Thomper here : https://jitpack.io/p/thomper/sweet-alert-dialog/v1.4.0

Cheers Man!!!!

@scdhao
Copy link

scdhao commented Feb 5, 2018

just copy res/anim folder to project

@scdhao
Copy link

scdhao commented Feb 5, 2018

copy res/anim folder to project
edit error_frame_in.xml
remove Rotate3dAnimation

@kkman2008
Copy link

it seems working after configuration as following:
copy res/anim folder to project
edit error_frame_in.xml
remove Rotate3dAnimation

@Bha91
Copy link

Bha91 commented Jun 22, 2019

this solved mine:
add this to proguard:
-keep class cn.pedant.SweetAlert.Rotate3dAnimation { public (...); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests