Crash on Android - Can only use lower 16 bits for requestCode
See original GitHub issueThe app crashes on Android with the following stack trace:
java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode
at android.support.v4.app.BaseFragmentActivityApi14.checkForValidRequestCode(BaseFragmentActivityApi14.java:79)
at android.support.v4.app.BaseFragmentActivityApi14.startIntentSenderForResult(BaseFragmentActivityApi14.java:66)
at android.support.v4.app.FragmentActivity.startIntentSenderForResult(FragmentActivity.java:67)
at com.google.android.gms.common.api.Status.startResolutionForResult
at com.google.android.gms.common.api.ResolvableApiException.startResolutionForResult
at com.google.android.gms.wallet.AutoResolveHelper.zza
at com.google.android.gms.wallet.AutoResolveHelper.zzb
at com.google.android.gms.wallet.AutoResolveHelper$zzb.zze
at com.google.android.gms.wallet.AutoResolveHelper$zzb.zza
at com.google.android.gms.wallet.AutoResolveHelper$zza.zzbjy
at com.google.android.gms.wallet.AutoResolveHelper$zza.onComplete
at com.google.android.gms.tasks.zzf.run
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
FragmentActivity requires the requestCode to be of 16 bits, meaning the range is from 0 to 65535. So when calling AutoResolveHelper.resolveTask
, the requestCode passed to it must be between 0 and 65535… but it’s 100500. It works if i change the value to anything less than or equal to 65535.
EDIT: the constant that I’m talking about is LOAD_PAYMENT_DATA_REQUEST_CODE
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Can only use lower 16 bits for requestCode - Stack Overflow
The problem has been fixed in the latest version of activity (1.2.7-alpha07). now it's warning you about adding both activity and fragment ...
Read more >Can only use lower 16 bits for requestCode | by Anum Amin
ActivityResultLauncher Crash — Can only use lower 16 bits for requestCode. I was trying a new way of writing runtime permissions on Android....
Read more >Can only use lower 16 bits for requestCode - Forums
My app uses ACRA for error reporting, and I've got a couple of reports from kindles with the error: Can only use lower...
Read more >Can only use lower 16 bits for requestCode-android-Java
[Solved]-Android app crash: java.lang.IllegalArgumentException: Can only use lower 16 bits for requestCode-android-Java ... I found some others questions in the ...
Read more >Android – ACRA exception Can only use lower 16 bits for ... - iTecNote
My app uses ACRA for error reporting, and I've got a couple of reports from my device with the error: Can only use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@brilliantjc understood. We will do PR tomorrow or you can do it now
SO: find this document
change this LOAD_PAYMENT_DATA_REQUEST_CODE to lower than 65535