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

Robolectric tests with sweet alert failing #39

Open athkalia opened 9 years ago

athkalia commented 9 years ago

I am getting this exception when running robolectric tests:

android.content.res.Resources$NotFoundException: Resource ID #0x7f0a0001
    at android.content.res.Resources.getValue(Resources.java:1118)
    at android.content.res.Resources.getDimensionPixelSize(Resources.java:613)
    at cn.pedant.SweetAlert.ProgressHelper.<init>(ProgressHelper.java:22)
    at cn.pedant.SweetAlert.SweetAlertDialog.<init>(SweetAlertDialog.java:78)
    at com.myapp.activity.register.RegisterActivity.showNotConnectedToTheInternetDialog(RegisterActivity.java:213)

If i add the library project in the projet.properties file like this:

android.library.reference.1=gen-external-apklibs/cn.pedant.sweetalert_library_1.3.1

then I get this exception:

java.lang.RuntimeException: Unknown animation name: sweet:cn.pedant.SweetAlert.Rotate3dAnimation error:sweet:cn.pedant.SweetAlert.Rotate3dAnimation
    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.myapp.activity.register.RegisterActivity.showNotConnectedToTheInternetDialog(RegisterActivity.java:213)

Have you tried running robolectric tests yourself ?

vidalbenjoe commented 9 years ago

try to add this line in your proguard file -keep class cn.pedant.* { ; }

athkalia commented 9 years ago

I doubt this is related in any way. I only have this problem when running tests not when running the app. Also I am not using proguard at all..