Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Unexpected IllegalArgumentException in CardIOActivity.onCreate #14

Closed
ryazmin opened this issue Apr 30, 2014 · 7 comments
Closed

Unexpected IllegalArgumentException in CardIOActivity.onCreate #14

ryazmin opened this issue Apr 30, 2014 · 7 comments
Labels

Comments

@ryazmin
Copy link

ryazmin commented Apr 30, 2014

In some rare cases the CardIOActivity unexpectedly throws exception IllegalArgumentException due to invalid token.
The token is valid and it's provided with intent.

Caused by: java.lang.IllegalArgumentException: A valid card.io app token must be supplied as a stringExtra with the key CardIOActivity.EXTRA_APP_TOKEN. Get one at https://card.io
at io.card.payment.CardIOActivity.onCreate()

@tomwhipple tomwhipple added the bug label May 8, 2014
@mattjacunski
Copy link
Contributor

This can happen if the token (extracted from the intent using .getStringExtra(EXTRA_APP_TOKEN) value is null, the length is 0, or the token string contains a space. Could it be that a space character was inadvertently included?

@mattjacunski
Copy link
Contributor

Please re-open this issue or file a new one if this problem persists.

@fcduarte
Copy link

+1 for the issue .. It affects a really small portion of our users, here's a more complete stacktrace from crittercism:

Stack Trace
_________________________________
0   java.lang.RuntimeException: Unable to start activity ComponentInfo{a.b.android.app/io.card.payment.CardIOActivity}: java.lang.IllegalArgumentException: A valid card.io app token must be supplied as a stringExtra with the key CardIOActivity.EXTRA_APP_TOKEN. Get one at https://card.io
1       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
2       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
3       at android.app.ActivityThread.access$800(ActivityThread.java:148)
4       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
5       at android.os.Handler.dispatchMessage(Handler.java:122)
6       at android.os.Looper.loop(Looper.java:136)
7       at android.app.ActivityThread.main(ActivityThread.java:5105)
8       at java.lang.reflect.Method.invokeNative(Native Method)
9       at java.lang.reflect.Method.invoke(Method.java:515)
10      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
11      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
12      at dalvik.system.NativeStart.main(Native Method)
13  Caused by: java.lang.IllegalArgumentException: A valid card.io app token must be supplied as a stringExtra with the key CardIOActivity.EXTRA_APP_TOKEN. Get one at https://card.io
14      at io.card.payment.CardIOActivity.onCreate(Unknown Source)
15      at android.app.Activity.performCreate(Activity.java:5437)
16      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1092)
17      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2172)
18      ... 11 more
19  java.lang.IllegalArgumentException: A valid card.io app token must be supplied as a stringExtra with the key CardIOActivity.EXTRA_APP_TOKEN. Get one at https://card.io
20      at io.card.payment.CardIOActivity.onCreate(Unknown Source)
21      at android.app.Activity.performCreate(Activity.java:5437)
22      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1092)
23      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2172)
24      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
25      at android.app.ActivityThread.access$800(ActivityThread.java:148)
26      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
27      at android.os.Handler.dispatchMessage(Handler.java:122)
28      at android.os.Looper.loop(Looper.java:136)
29      at android.app.ActivityThread.main(ActivityThread.java:5105)
30      at java.lang.reflect.Method.invokeNative(Native Method)
31      at java.lang.reflect.Method.invoke(Method.java:515)
32      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
33      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
34      at dalvik.system.NativeStart.main(Native Method)

@VasilyRyabov
Copy link

Same issue. Could you check that you save token after system kill and re-create activity with no extras intent?

@braebot
Copy link
Member

braebot commented Oct 14, 2014

Please download the latest SDK (3.2.0+). We have removed the concept of APP_TOKENS entirely, and so this exception should never occur again. 👔

@ShahMaitri
Copy link

I am getting below kind of error while using CardIOActivity. Need suggestions to solve this

11-12 01:59:43.565: E/dalvikvm(2885): Could not find class 'io.card.payment.CreditCard', referenced from method org.my.scanExample.MyScanActivity.onActivityResult

@braebot
Copy link
Member

braebot commented Nov 12, 2014

Thanks @ShahMaitri. I'll address your comment in #31.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants