Using the Stripe library and sample located here. When I attempt to create a token in the release version of our app I get the following stacktrace:
java.lang.RuntimeException: An error occured while executing doInBackground()
at com.stripe.android.compat.AsyncTask$3.done(AsyncTask.java:250)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ExceptionInInitializerError
at com.stripe.net.APIResource.<clinit>(APIResource.java:37)
at com.stripe.android.Stripe$1$1.doInBackground(Stripe.java:28)
at com.stripe.android.Stripe$1$1.doInBackground(Stripe.java:23)
at com.stripe.android.compat.AsyncTask$2.call(AsyncTask.java:236)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 3 more
Caused by: java.lang.RuntimeException: Missing type parameter.
at com.google.a.c.a.getSuperclassTypeParameter(TypeToken.java:84)
at com.google.a.c.a.<init>(TypeToken.java:62)
at com.stripe.model.FeeRefundCollectionDeserializer$1.<init>(FeeRefundCollectionDeserializer.java:17)
at com.stripe.model.FeeRefundCollectionDeserializer.<clinit>(FeeRefundCollectionDeserializer.java:17)
... 8 more
Seems to work fine using a debug build. I am using proguard and have added the exclusion noted in the docs:
-keep class com.stripe.** { *; }
The card I'm using is a test one which gracefully tells me it's a test card being used with a live key when I run a debug apk. When I attempt the same in a live apk it produces this crash.
Testing without any proguard at all now...
EDIT:
Okay I have turned off proguard completely and it seems to have made the issue go away. So now I'll try and dig around with my extremely limited proguard knowledge to try and figure out what's going on here :)
Here is my full proguard-rules.pro file:
-dontwarn com.facebook.**
-dontwarn org.joda.time.**
-dontwarn org.codehaus.**
-dontwarn java.nio.**
-dontnote **ILicensingService
-keep class com.crashlytics.** { *; }
-keep class com.crashlytics.android.**
-keep class com.stripe.** { *; }
-keepattributes SourceFile,LineNumberTable,*Annotation*