square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android - Something went wrong. Please contact the developer of this application and provide them with this error code: reader_settings_unexpected

fobos531 opened this issue · comments

Describe the issue

Hello, on some of the android devices our users are not able to use the reader SDK. Specifically - they get the following error when trying to open Square reader settings.

Something went wrong. Please contact the developer of this application and provide them with this error code: reader_settings_unexpected

This is on Android 12/13. Unfortunately, I cannot provide more context than that.

To Reproduce

  1. initialize SDK
  2. try to open the reader sdk settings

Expected behavior

The settings should open just fine.

Environment (please complete the following information):

  • platform: Android 12/13
  • reader SDK version: latest stable v1

Screenshots

Additional context

Any idea what might be causing this? Please let me know if there's anything I can do to assist. Thanks!

Can you tell us the merchant location_id you're running in, so we can look at what happened? I'm not finding that string in our current code. Also, "latest stable v1" Reader SDK should be 1.7.4, but can you confirm that?

Hey @fka3 , sure! I have a few you can take look at:

LM9H31BCEZT9N
LT2DTJXNC9TZJ
LCJKPXDPGM8AQ
L0ZFYYXMRQE3N
L1QHP3VJQ29JW

I think at least one of them should have experienced this error, but if not, I can probably pull up a few more

Can you find one that you know has experienced it, vs me going hunting across a half-dozen? We don't find that string in our code today, so while I'm happy to do the needle-in-a-haystack thing, I kinda want to know that there is a needle in this haystack. ;-)

Better yet, if you can give me a timestamp as well as a location, that'd make it much easier!

Can you find one that you know has experienced it, vs me going hunting across a half-dozen? We don't find that string in our code today, so while I'm happy to do the needle-in-a-haystack thing, I kinda want to know that there is a needle in this haystack. ;-)

Better yet, if you can give me a timestamp as well as a location, that'd make it much easier!

Hey, completely understandable :)

LT2DTJXNC9TZJ

This is a location that for sure experienced it. The specific time when it occured is Mar 26, 2023 10:50:38 PM UTC. Device model is SM-S901U running Android 13, specifically build number TP1A.220624.014.S901USQU2CWAI. Here's a list of permissions that have been granted to the app:

{
ACCESS_COARSE_LOCATION: granted, 
ACCESS_FINE_LOCATION: granted, 
ACCESS_MEDIA_LOCATION: granted, 
ACCESS_NETWORK_STATE: granted, 
ACCESS_WIFI_STATE: granted, 
ACTIVITY_RECOGNITION: granted, 
BADGE_COUNT_READ: not_granted, 
BADGE_COUNT_WRITE: not_granted, 
BIND_GET_INSTALL_REFERRER_SERVICE: granted, 
BLUETOOTH_ADVERTISE: not_granted, 
BLUETOOTH_CONNECT: not_granted, 
BLUETOOTH_SCAN: not_granted, 
BROADCAST_BADGE: not_granted, 
CAMERA: not_granted, 
CHANGE_BADGE: not_granted, 
CHANGE_WIFI_STATE: granted, 
FOREGROUND_SERVICE: granted, 
INTERNET: granted, 
MODIFY_AUDIO_SETTINGS: granted, 
POST_NOTIFICATIONS: granted, 
PROVIDER_INSERT_BADGE: not_granted, 
READ: granted, 
READ_APP_BADGE: not_granted, 
READ_CONTACTS: not_granted, 
READ_EXTERNAL_STORAGE: not_granted, 
READ_GSERVICES: granted, 
READ_MEDIA_AUDIO: not_granted, 
READ_MEDIA_IMAGES: granted, 
READ_MEDIA_VIDEO: granted, 
READ_PHONE_STATE: not_granted, 
READ_SETTINGS: not_granted, 
RECEIVE: granted, 
RECEIVE_BOOT_COMPLETED: granted, 
RECORD_AUDIO: granted, 
SCHEDULE_EXACT_ALARM: granted, 
SYSTEM_ALERT_WINDOW: not_granted, 
UPDATE_BADGE: not_granted, 
UPDATE_COUNT: not_granted, 
UPDATE_SHORTCUT: not_granted, 
USE_BIOMETRIC: granted, 
USE_FINGERPRINT: granted, 
VIBRATE: granted, 
WAKE_LOCK: granted, 
WRITE: not_granted, 
WRITE_CONTACTS: not_granted, 
WRITE_EXTERNAL_STORAGE: not_granted, 
WRITE_SETTINGS: not_granted
}

A similar kind of issue happens when invoking startCheckoutAsync, but with a slightly different error message: "unexpected". The location that experienced this is LM9H31BCEZT9N and the issue occured at Mar 30, 2023 18:20:51 UTC. The stack trace is for that error is:

{
  "nativeStackAndroid": [
    {
      "lineNumber": 101,
      "file": "CheckoutModule.java",
      "methodName": "onResult",
      "class": "com.squareup.sdk.reader.react.CheckoutModule$1"
    },
    {
      "lineNumber": 93,
      "file": "CheckoutModule.java",
      "methodName": "onResult",
      "class": "com.squareup.sdk.reader.react.CheckoutModule$1"
    },
    {
      "lineNumber": 138,
      "file": "IntentCheckoutManager.java",
      "methodName": "sendResult",
      "class": "com.squareup.sdk.reader.checkout.IntentCheckoutManager$CallbackHolderWithAnalytics"
    },
    {
      "lineNumber": 121,
      "file": "IntentCheckoutManager.java",
      "methodName": "sendErrorResult",
      "class": "com.squareup.sdk.reader.checkout.IntentCheckoutManager"
    },
    {
      "lineNumber": 185,
      "file": "ResultFragment.kt",
      "methodName": "sendError",
      "class": "com.squareup.sdk.reader.core.ResultFragment"
    },
    {
      "lineNumber": 150,
      "file": "ResultFragment.kt",
      "methodName": "onActivityResult",
      "class": "com.squareup.sdk.reader.core.ResultFragment"
    },
    {
      "lineNumber": 8977,
      "file": "Activity.java",
      "methodName": "dispatchActivityResult",
      "class": "android.app.Activity"
    },
    {
      "lineNumber": 5987,
      "file": "ActivityThread.java",
      "methodName": "deliverResults",
      "class": "android.app.ActivityThread"
    },
    {
      "lineNumber": 6033,
      "file": "ActivityThread.java",
      "methodName": "handleSendResult",
      "class": "android.app.ActivityThread"
    },
    {
      "lineNumber": 67,
      "file": "ActivityResultItem.java",
      "methodName": "execute",
      "class": "android.app.servertransaction.ActivityResultItem"
    },
    {
      "lineNumber": 45,
      "file": "ActivityTransactionItem.java",
      "methodName": "execute",
      "class": "android.app.servertransaction.ActivityTransactionItem"
    },
    {
      "lineNumber": 135,
      "file": "TransactionExecutor.java",
      "methodName": "executeCallbacks",
      "class": "android.app.servertransaction.TransactionExecutor"
    },
    {
      "lineNumber": 95,
      "file": "TransactionExecutor.java",
      "methodName": "execute",
      "class": "android.app.servertransaction.TransactionExecutor"
    },
    {
      "lineNumber": 2574,
      "file": "ActivityThread.java",
      "methodName": "handleMessage",
      "class": "android.app.ActivityThread$H"
    },
    {
      "lineNumber": 106,
      "file": "Handler.java",
      "methodName": "dispatchMessage",
      "class": "android.os.Handler"
    },
    {
      "lineNumber": 226,
      "file": "Looper.java",
      "methodName": "loopOnce",
      "class": "android.os.Looper"
    },
    {
      "lineNumber": 313,
      "file": "Looper.java",
      "methodName": "loop",
      "class": "android.os.Looper"
    },
    {
      "lineNumber": 8757,
      "file": "ActivityThread.java",
      "methodName": "main",
      "class": "android.app.ActivityThread"
    },
    {
      "lineNumber": -2,
      "file": "Method.java",
      "methodName": "invoke",
      "class": "java.lang.reflect.Method"
    },
    {
      "lineNumber": 571,
      "file": "RuntimeInit.java",
      "methodName": "run",
      "class": "com.android.internal.os.RuntimeInit$MethodAndArgsCaller"
    },
    {
      "lineNumber": 1067,
      "file": "ZygoteInit.java",
      "methodName": "main",
      "class": "com.android.internal.os.ZygoteInit"
    }
  ],
  "userInfo": null,
  "message": "Something went wrong. Please contact the developer of this application and provide them with this error code: unexpected",
  "code": "USAGE_ERROR",
  "debugCode": "unexpected",
  "debugMessage": "The Square Reader SDK encountered an unexpected error. Please contact Square developer support via http://squareup.com/help/contact"
}

Hope that helps!

Thanks for the list of permissions @fobos531! One thing that stood out was the not granted bluetooth permissions. Can you have those users go into their phone's App settings to grant the app the bluetooth permission and see if that fixes things for them (here's Google's guide on enabling permissions for specific apps: link)? Obviously this isn't an ideal solutions but it'll be a potential un-blocker until we figure out how we ended up in this state.