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:nul

Open lan5572 opened this issue 8 years ago • 45 comments

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

lan5572 avatar May 27 '17 03:05 lan5572

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.

gsteigert avatar May 31 '17 18:05 gsteigert

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

sametbars avatar Jun 02 '17 17:06 sametbars

refer https://github.com/pedant/sweet-alert-dialog/issues/6

Nishant-Pathak avatar Jun 05 '17 11:06 Nishant-Pathak

@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.

gsteigert avatar Jun 05 '17 12:06 gsteigert

跟混淆有个毛线的关系啊.....

cjztool avatar Jun 08 '17 07:06 cjztool

'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'

prokash-sarkar avatar Jun 16 '17 14:06 prokash-sarkar

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

ogasimli avatar Jun 29 '17 20:06 ogasimli

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

spurts51 avatar Jul 18 '17 12:07 spurts51

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)

omeramiel avatar Jul 18 '17 15:07 omeramiel

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

khoatd92 avatar Aug 03 '17 23:08 khoatd92

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

khoatd92 avatar Aug 03 '17 23:08 khoatd92

o(╥﹏╥)o

haoweizero avatar Aug 07 '17 01:08 haoweizero

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

khoatd92 avatar Aug 07 '17 02:08 khoatd92

+1

pcg92 avatar Aug 19 '17 12:08 pcg92

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?

KeyurKba avatar Aug 29 '17 04:08 KeyurKba

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.

KD-Dhiren avatar Aug 29 '17 06:08 KD-Dhiren

download sc to local , can fix it
我下载源码到本机,这个问题自己就好了....

cjztool avatar Aug 29 '17 07:08 cjztool

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

ga1ya avatar Sep 11 '17 11:09 ga1ya

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

ga1ya avatar Sep 11 '17 11:09 ga1ya

abandon this library immediatly

lacuz avatar Sep 13 '17 02:09 lacuz

@lacuz suggest another library

ivzb avatar Sep 25 '17 10:09 ivzb

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

@sitonthegold this is not a good option :)

ivzb avatar Oct 01 '17 08:10 ivzb

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

@ivzb try to keep class work for me.

sitonthegold avatar Oct 02 '17 14:10 sitonthegold

it can be closed

pcg92 avatar Oct 17 '17 11:10 pcg92

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`

francescogatto avatar Oct 26 '17 07:10 francescogatto

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

pcg92 avatar Oct 26 '17 07:10 pcg92

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.

francescogatto avatar Oct 26 '17 08:10 francescogatto

@Francescogatto find and remove all the errors xD

pcg92 avatar Oct 26 '17 08:10 pcg92

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

francescogatto avatar Oct 26 '17 08:10 francescogatto

@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

wazzah-marham avatar Oct 30 '17 07:10 wazzah-marham

@wazzah-marham https://github.com/pedant/sweet-alert-dialog/issues/136#issuecomment-337208402 change your compile version and remove some maven dependencies

pcg92 avatar Oct 30 '17 08:10 pcg92

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

shylendramadda avatar Oct 31 '17 09:10 shylendramadda

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

anisha219 avatar Nov 01 '17 16:11 anisha219

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

steven123151988 avatar Nov 09 '17 08:11 steven123151988

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.

thomper avatar Nov 13 '17 04:11 thomper

@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.

SetareMaghari avatar Nov 19 '17 15:11 SetareMaghari

@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

thomper avatar Nov 20 '17 03:11 thomper

@thomper thanks u're saving us time here !

AmalH avatar Nov 29 '17 23:11 AmalH

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

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

Cheers Man!!!!

jumaallan avatar Jan 03 '18 22:01 jumaallan

just copy res/anim folder to project

scdhao avatar Feb 05 '18 14:02 scdhao

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

scdhao avatar Feb 05 '18 14:02 scdhao

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

kkman2008 avatar Aug 25 '18 23:08 kkman2008

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

Bha91 avatar Jun 22 '19 12:06 Bha91