square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start receiver com.squareup.queue.QueueService$BootReceiver: java.lang.SecurityException: getSerial: The user 10191 does not meet the requirements to access device identifiers

SudoPlz opened this issue · comments

Describe the issue

When I try to launch the app on Android Q (10) the app instantly crashes.

Error log details:

java.lang.RuntimeException Unable to start receiver com.squareup.queue.QueueService$BootReceiver: java.lang.SecurityException: getSerial: The user 10191 does not meet the requirements to access device identifiers. 
  ActivityThread.java:3797 android.app.ActivityThread.handleReceiver
  ActivityThread.java:219 android.app.ActivityThread.access$1400
  ActivityThread.java:1870 android.app.ActivityThread$H.handleMessage
  Handler.java:107 android.os.Handler.dispatchMessage
  Looper.java:214 android.os.Looper.loop
  ActivityThread.java:7356 android.app.ActivityThread.main
  Method.java:-2 java.lang.reflect.Method.invoke
  RuntimeInit.java:492 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
  ZygoteInit.java:930 com.android.internal.os.ZygoteInit.main


Caused by: java.lang.SecurityException getSerial: The user 10191 does not meet the requirements to access device identifiers. 
  Parcel.java:2071 android.os.Parcel.createException
  Parcel.java:2039 android.os.Parcel.readException
  Parcel.java:1987 android.os.Parcel.readException
  IDeviceIdentifiersPolicyService.java:159 android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage
  Build.java:162 android.os.Build.getSerial
  AndroidModule.java:234 com.squareup.util.AndroidModule.provideBuild
  AndroidModule_ProvideBuildFactory.java:32 com.squareup.util.AndroidModule_ProvideBuildFactory.proxyProvideBuild
  AndroidModule_ProvideBuildFactory.java:23 com.squareup.util.AndroidModule_ProvideBuildFactory.get
  AndroidModule_ProvideBuildFactory.java:9 com.squareup.util.AndroidModule_ProvideBuildFactory.get
  CrashReportingLogger_Factory.java:86 com.squareup.log.CrashReportingLogger_Factory.get
  CrashReportingLogger_Factory.java:11 com.squareup.log.CrashReportingLogger_Factory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  CommonAppModule_Real_ProvideForegroundServiceStarterFactory.java:47 com.squareup.CommonAppModule_Real_ProvideForegroundServiceStarterFactory.get
  CommonAppModule_Real_ProvideForegroundServiceStarterFactory.java:14 com.squareup.CommonAppModule_Real_ProvideForegroundServiceStarterFactory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  QueueService_Starter_Factory.java:27 com.squareup.queue.QueueService_Starter_Factory.get
  QueueService_Starter_Factory.java:9 com.squareup.queue.QueueService_Starter_Factory.get
  DoubleCheck.java:47 dagger.internal.DoubleCheck.get
  DaggerReaderSdkReleaseAppComponent.java:4357 com.squareup.DaggerReaderSdkReleaseAppComponent.injectBootReceiver
  DaggerReaderSdkReleaseAppComponent.java:4267 com.squareup.DaggerReaderSdkReleaseAppComponent.inject
  QueueService.java:412 com.squareup.queue.QueueService$BootReceiver.onReceive
  ActivityThread.java:3788 android.app.ActivityThread.handleReceiver
  ActivityThread.java:219 android.app.ActivityThread.access$1400
  ActivityThread.java:1870 android.app.ActivityThread$H.handleMessage
  Handler.java:107 android.os.Handler.dispatchMessage
  Looper.java:214 android.os.Looper.loop
  ActivityThread.java:7356 android.app.ActivityThread.main
  Method.java:-2 java.lang.reflect.Method.invoke
  RuntimeInit.java:492 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run
  ZygoteInit.java:930 com.android.internal.os.ZygoteInit.main

Environment (please complete the following information):

  • Platform: Pixel 2 XL on Android Q (10) - device
  • react-native-square-reader-sdk version: 98e75a0
  • Android SDK version: 1.3.2
React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
      Memory: 20.69 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      Yarn: 1.12.1 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5692245
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3
      react-native: 0.59.9 => 0.59.9
    npmGlobalPackages:
      react-native-cli: 2.0.1

Hi @SudoPlz just to double-check, are you targeting Android 9 or 10 in your gradle file? You should be targeting 9 or lower, but it should still be able to run on Android 10 if you're using Android ReaderSDK 1.3.2 as far as I know. If all of this is true, please let me know and we can look into this further.

I am indeed targeting android 10 (api 29), good catch.

Will that bug be gone if I target android 9? (api 28) ?

Thanks

I believe so! As far as I know, if you're using Android 1.3.2 for ReaderSDK and targeting Android 9 (API 28), it will allow for running on both Android 9 and Android 10 devices. With that said, of course let me know if that's not your experience, or if you run into any other issues!

I have same problem with android readersdk 1.3.3

FATAL EXCEPTION: main
    Process: com.myapp.mobile, PID: 18961
    java.lang.RuntimeException: Unable to create application com.myapp.mobile.MyApplication: java.lang.SecurityException: getSerial: The user 10222 does not meet the requirements to access device identifiers.
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6465)
        at android.app.ActivityThread.access$1300(ActivityThread.java:219)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at 

Any help will be appreciated.

Best Regards.

@eriknyk sorry for the delay. Are you targeting Android 9 (API 28) or lower?

Closing this for now. Please target Android 9 (API 28) or lower). If the issue still persists, please comment and I'll reopen.

@StephenJosey I was targeting android10, and yes targeting to Android 9 solved the problem for now, thanks.

java.lang.SecurityException:
at android.os.Parcel.createException (Parcel.java:2071)
at android.os.Parcel.readException (Parcel.java:2039)
at android.os.Parcel.readException (Parcel.java:1987)
at android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage (IDeviceIdentifiersPolicyService.java:159)
at android.os.Build.getSerial (Build.java:170)
at com.yandex.metrica.impl.ob.lt.a (SourceFile:60)
at com.yandex.metrica.impl.ob.lt. (SourceFile:48)
at com.yandex.metrica.impl.ob.ls.a (SourceFile:45)
at com.yandex.metrica.impl.ob.sd.a (SourceFile:304)
at com.yandex.metrica.impl.ob.ca.a (SourceFile:63)
at com.yandex.metrica.impl.ob.bi.b (SourceFile:27)
at com.yandex.metrica.impl.ob.cc.b (SourceFile:78)
at com.yandex.metrica.impl.ob.bh.a (SourceFile:92)
at com.yandex.metrica.impl.ob.bh.run (SourceFile:75)
at com.yandex.metrica.impl.ob.ur.execute (SourceFile:18)
at com.yandex.metrica.impl.ob.vd.execute (SourceFile:15)
at com.yandex.metrica.impl.ob.bb.run (SourceFile:90)
Caused by: android.os.RemoteException:
at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers (TelephonyPermissions.java:417)
at com.android.internal.telephony.TelephonyPermissions.checkReadDeviceIdentifiers (TelephonyPermissions.java:349)
at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers (TelephonyPermissions.java:274)
at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers (TelephonyPermissions.java:251)
at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage (DeviceIdentifiersPolicyService.java:67)