Open lan5572 opened 7 years ago
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.
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 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.
'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'
I have the same issue after upgrading to 3.0.0-alpha2 plugin version.
yes I also got the same issue this library doesn't supports the canary versions... I guess...
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.
I got the same issue when using com.android.tools.build:gradle:3.0.0-alpha9
. Any solution for that?
Look like @pedant don't maintain this project anymore. :(
o(╥﹏╥)o
btw, I already downloaded source code and import as a library and it works fine. No more error.
+1
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?
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.
i tried everthing... include download sc.. add proguard
@cjztool 你是下载了源码,如何配置的呢?求教
abandon this library immediatly
@lacuz suggest another library
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 this is not a good option :)
-keep class cn.pedant.SweetAlert.Rotate3dAnimation {
public
@ivzb try to keep class work for me.
it can be closed
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 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"
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 find and remove all the errors xD
right.. just remove apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' thx! :)
@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 https://github.com/pedant/sweet-alert-dialog/issues/136#issuecomment-337208402 change your compile version and remove some maven dependencies
Me too faced similar issue when I upgraded gradle 3.0.0 any solution for this?
@shylendramadda
这个怎么搞的 刚升级3.0.0就出现了。现在要返回2.3.3显然是不可能。
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 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 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 thanks u're saving us time here !
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 !!).
Just use this solution from Thomper here : https://jitpack.io/p/thomper/sweet-alert-dialog/v1.4.0
Cheers Man!!!!
just copy res/anim folder to project
copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation
it seems working after configuration as following: copy res/anim folder to project edit error_frame_in.xml remove Rotate3dAnimation
this solved mine:
add this to proguard:
-keep class cn.pedant.SweetAlert.Rotate3dAnimation { public
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