更新Android Studio 3.0和Gradle版本4.1后,SweetAlertDialog错误

时间:2017-10-29 08:38:38

标签: android gradle

更新后,我的应用程序没有出现任何错误,但是当我打开模拟器时,我找不到SweetAlertDialog库。调试模式而不是发布apk我在模拟器上尝试了它这次工作并没有给出一个错误。我不明白为什么它在调试模式下会出错。

FATAL EXCEPTION: main
                                                        Process: com.dinlenet, PID: 7427
                                                        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dinlenet/com.dinlenet.activitys.PermissionActivity}: java.lang.RuntimeException: Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
                                                            at android.app.ActivityThread.-wrap11(Unknown Source:0)
                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
                                                            at android.os.Handler.dispatchMessage(Handler.java:105)
                                                            at android.os.Looper.loop(Looper.java:164)
                                                            at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                         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.<init>(SweetAlertDialog.java:80)
                                                            at com.dinlenet.utils.DialogUtil.showSweetAlertDialogWithListener(DialogUtil.java:27)
                                                            at com.dinlenet.utils.RuntimePermissionsActivity.onCreate(RuntimePermissionsActivity.java:30)
                                                            at com.dinlenet.activitys.PermissionActivity.onCreate(PermissionActivity.java:25)
                                                            at android.app.Activity.performCreate(Activity.java:6975)
                                                            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
                                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
                                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
                                                            at android.app.ActivityThread.-wrap11(Unknown Source:0) 
                                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
                                                            at android.os.Handler.dispatchMessage(Handler.java:105) 
                                                            at android.os.Looper.loop(Looper.java:164) 
                                                            at android.app.ActivityThread.main(ActivityThread.java:6541) 
                                                            at java.lang.reflect.Method.invoke(Native Method) 
                                                            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

10-29 08:30:49.083 7427-7427 / com.dinlenet E / CrashlyticsCore:执行任务失败。

4 个答案:

答案 0 :(得分:2)

添加此库与新功能https://jitpack.io/p/Leogiroux/sweet-alert-dialog

相同

答案 1 :(得分:1)

尝试将此行添加到您的proguard文件中:

-keep class cn.pedant.SweetAlert.** { *; }

Reference此错误解决方案。这是来自SweetAlaert的Git Error问题页面。

答案 2 :(得分:0)

从build.graddle中删除依赖项并将其添加为模块,如下所示: https://github.com/pedant/sweet-alert-dialog/issues/148

答案 3 :(得分:0)

此库未维护

要解决此问题

修改文件 OptAnimationLoader

添加其他其他条件 / 案例

ORDER BY