question

Dave avatar image
Dave asked

Can only use lower 16 bits for requestCode

My app uses ACRA for error reporting, and I've got a couple of reports from kindles with the error: Can only use lower 16 bits for requestCode.. Google shows this error occurring when using startActivityForResult, but I've searched my code a few times and I"m not calling that anywhere. I'm pretty confused and am wondering how this is impacting users (interestingly enough, the Crash Reports beta doesn't show any errors at all). Anyone else run into this? java.lang.RuntimeException: Unable to resume activity {com.myapp/com.myapp.MyActivity}: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:957) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode at android.support.v4.app.g.startActivityForResult(SourceFile:690) at com.amazon.android.e.a.a(Unknown Source) at com.amazon.android.e.e.a(Unknown Source) at com.amazon.android.o.e.a(Unknown Source) at com.amazon.android.o.b.a(Unknown Source) at com.amazon.android.framework.context.d.a(Unknown Source) at com.amazon.android.framework.context.d.onResume(Unknown Source) at com.amazon.android.Kiwi.onResume(Unknown Source) at com.myapp.MyActivity.onResume(SourceFile) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150) at android.app.Activity.performResume(Activity.java:3832) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110) ... 10 more java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode at android.support.v4.app.g.startActivityForResult(SourceFile:690) at com.amazon.android.e.a.a(Unknown Source) at com.amazon.android.e.e.a(Unknown Source) at com.amazon.android.o.e.a(Unknown Source) at com.amazon.android.o.b.a(Unknown Source) at com.amazon.android.framework.context.d.a(Unknown Source) at com.amazon.android.framework.context.d.onResume(Unknown Source) at com.amazon.android.Kiwi.onResume(Unknown Source) at com.myapp.MyActivity.onResume(SourceFile) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150) at android.app.Activity.performResume(Activity.java:3832) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:957) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method)
fire tablet
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anshul@Amazon avatar image
Anshul@Amazon answered
Thank you for your post. By looking into just the stack trace its really difficult to say why you are getting this exception. Are you able to reproduce the error locally? If yes, can you please raise a ContactUs( https://developer.amazon.com/help/contactus.html) with your app details and steps to reproduce the error so that we can look into it and help you more in this regard.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

manoj avatar image
manoj answered
I am in the same situation. My app is ACRA enabled too. I submitted my updated app yesterday which is using FragmentActivity from android support library. I got a crash with exact same stack trace as mentioned above. I my not using startActivityForResult in my code but it is still complaining there.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sachin@Amazon avatar image
Sachin@Amazon answered
Hi, The APIs provided by Amazon Mobile App SDK does not internally call startActivityForResult(). Can you please check with the ACRA team if they are using this API internally?
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.