square/reader-sdk-android-quickstart

Android Reader SDK Support for Android 10 and Above

davenotdavid opened this issue ยท 18 comments

Are there any updates on support for Android Q/10/API 29 and above yet? If so, which Reader SDK version? Because, v1.3.6 throws a security exception as of now, which is most likely related to trying to access the identifier (i.e. IMEI) as it says here in the docs. And no, enforcing the READ_PRIVILEGED_PHONE_STATE permission doesn't seem to be a potential workaround here as it mentions, Caution: Third-party apps installed from the Google Play Store cannot declare privileged permissions.

Despite being blunt on my end to assume that this SDK will support the latest Android version in the first place (especially since Android 10 has been around for awhile), are there any workarounds for this in the meantime?

Hey @davenotdavid apologies on this. We are definitely working to support the latest versions, although no ETA on when this work will be complete. Would you be able/willing to provide your crash logs here so we can help address these particular issues that you mentioned (we did not see crashes on API 29 ourselves in our demo app)?

@StephenJosey


UPDATE: Well, the demo app didn't work when I had manually updated the SDK versions to 29 (i.e. compileSdkVersion, buildToolsVersion, targetSdkVersion, and etc.) in the app-level Gradle file, but yes, it seems like the whole process works when targeting 28 after running on my API 29 device.

Unfortunately though, our app is targeting API 29 and it'd be somewhat problematic to downgrade to 28 to use this SDK properly ๐Ÿคทโ€โ™‚๏ธ


Here are the logs (seems like it's crashing from ReaderSdk.initialize(this) within the Application class) on our end which is pretty similar to the demo app here after running on my personal Android API 29 device:

Our end when opening the app:

java.lang.RuntimeException: Unable to create application com.angieslist.sp.DebugSPApp: java.lang.SecurityException: getSerial: The user 10160 does not meet the requirements to access device identifiers.
at com.squareup.sdk.reader.internal.AppBootstrapHolder.onCreate(AppBootstrapHolder.java:23)
at com.squareup.sdk.reader.ReaderSdk.initialize(ReaderSdk.java:38)

Demo app when opening the app:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.readersdk, PID: 32282
    java.lang.RuntimeException: Unable to create application com.example.readersdk.ExampleApplication: java.lang.SecurityException: getSerial: The user 10453 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 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.SecurityException: getSerial: The user 10453 does not meet the requirements to access device identifiers.
        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:162)
        at com.squareup.android.util.ContextKt.getAndroidSerial(Context.kt:28)
        at com.squareup.android.util.AndroidUtilModule.provideAndroidSerial(AndroidUtilModule.kt:59)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.provideAndroidSerial(AndroidUtilModule_ProvideAndroidSerialFactory.java:37)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:27)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:9)
        at com.squareup.log.CrashReportingLogger_Factory.get(CrashReportingLogger_Factory.java:81)
        at com.squareup.log.CrashReportingLogger_Factory.get(CrashReportingLogger_Factory.java:13)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.ProductionServerModule_ProvideApiUrlSelectorFactory.get(ProductionServerModule_ProvideApiUrlSelectorFactory.java:27)
        at com.squareup.ProductionServerModule_ProvideApiUrlSelectorFactory.get(ProductionServerModule_ProvideApiUrlSelectorFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.http.interceptor.UrlRedirectInterceptor_Factory.get(UrlRedirectInterceptor_Factory.java:35)
        at com.squareup.http.interceptor.UrlRedirectInterceptor_Factory.get(UrlRedirectInterceptor_Factory.java:10)
        at dagger.internal.SetFactory.get(SetFactory.java:126)
        at dagger.internal.SetFactory.get(SetFactory.java:37)
        at com.squareup.http.HttpReleaseModule_ProvideOkHttpClientBuilderFactory.get(HttpReleaseModule_ProvideOkHttpClientBuilderFactory.java:33)
        at com.squareup.http.HttpReleaseModule_ProvideOkHttpClientBuilderFactory.get(HttpReleaseModule_ProvideOkHttpClientBuilderFactory.java:12)
        at com.squareup.http.HttpModule_ProvideUnauthenticatedClientFactory.get(HttpModule_ProvideUnauthenticatedClientFactory.java:27)
        at com.squareup.http.HttpModule_ProvideUnauthenticatedClientFactory.get(HttpModule_ProvideUnauthenticatedClientFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedRetrofitFactory.get(RetrofitModule_ProvideUnauthenticatedRetrofitFactory.java:49)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedRetrofitFactory.get(RetrofitModule_ProvideUnauthenticatedRetrofitFactory.java:14)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.get(RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.java:28)
E/AndroidRuntime:     at com.squareup.server.RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.get(RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.java:10)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at dagger.internal.DelegateFactory.get(DelegateFactory.java:36)
        at com.squareup.server.analytics.EventStreamModule_Prod_ProvideEventStreamServiceFactory.get(EventStreamModule_Prod_ProvideEventStreamServiceFactory.java:27)
        at com.squareup.server.analytics.EventStreamModule_Prod_ProvideEventStreamServiceFactory.get(EventStreamModule_Prod_ProvideEventStreamServiceFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.analytics.Es1BatchUploader_Factory.get(Es1BatchUploader_Factory.java:24)
        at com.squareup.server.analytics.Es1BatchUploader_Factory.get(Es1BatchUploader_Factory.java:7)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.analytics.EventStreamModule_ProvideEventStreamFactory.get(EventStreamModule_ProvideEventStreamFactory.java:82)
        at com.squareup.server.analytics.EventStreamModule_ProvideEventStreamFactory.get(EventStreamModule_ProvideEventStreamFactory.java:16)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.analytics.EventStreamAnalytics_Factory.get(EventStreamAnalytics_Factory.java:42)
        at com.squareup.analytics.EventStreamAnalytics_Factory.get(EventStreamAnalytics_Factory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.getReaderSdkAdditionalCrashLogger(DaggerReaderSdkReleaseAppComponent.java:2941)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.getSetOfCrashAdditionalLogger(DaggerReaderSdkReleaseAppComponent.java:2947)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.exceptionHandlerDependencies(DaggerReaderSdkReleaseAppComponent.java:3625)
        at com.squareup.log.RegisterExceptionHandler.resolveDependencies(RegisterExceptionHandler.java:98)
        at com.squareup.RegisterAppDelegate.createAppScope(RegisterAppDelegate.java:359)
        at com.squareup.RegisterAppDelegate.onCreate(RegisterAppDelegate.java:217)
        at com.squareup.sdk.reader.internal.AppBootstrapHolder.onCreate(AppBootstrapHolder.java:23)
        at com.squareup.sdk.reader.ReaderSdk.initialize(ReaderSdk.java:38)
        at com.example.readersdk.ExampleApplication.onCreate(ExampleApplication.java:12)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
        	... 8 more
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers(TelephonyPermissions.java:437)
        at com.android.internal.telephony.TelephonyPermissions.checkPrivilegedReadPermissionOrCarrierPrivilegePermission(TelephonyPermissions.java:369)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:275)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:252)
        at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage(DeviceIdentifiersPolicyService.java:67)

And right when starting the checkout process (from checkoutManager.startCheckoutActivity(this, params.build());)

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.readersdk, PID: 3870
    io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.SecurityException: getSerial: The user 10453 does not meet the requirements to access device identifiers.
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
        at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:46)
        at io.reactivex.internal.operators.single.SingleDoOnSuccess$DoOnSuccess.onError(SingleDoOnSuccess.java:65)
        at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
        at io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onError(SingleFlatMap.java:90)
        at io.reactivex.internal.observers.ResumeSingleObserver.onError(ResumeSingleObserver.java:51)
        at io.reactivex.internal.disposables.EmptyDisposable.error(EmptyDisposable.java:78)
        at io.reactivex.internal.operators.single.SingleError.subscribeActual(SingleError.java:42)
        at io.reactivex.Single.subscribe(Single.java:3666)
        at io.reactivex.internal.operators.single.SingleResumeNext$ResumeMainSingleObserver.onError(SingleResumeNext.java:80)
        at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69)
        at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        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 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: io.reactivex.exceptions.OnErrorNotImplementedException: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | java.lang.SecurityException: getSerial: The user 10453 does not meet the requirements to access device identifiers.
        at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$1$2.apply(ReceivedResponse.kt:146)
        at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$1$2.apply(ReceivedResponse.kt:113)
        at io.reactivex.internal.operators.single.SingleResumeNext$ResumeMainSingleObserver.onError(SingleResumeNext.java:73)
        at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onError(SingleMap.java:69) 
        at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79) 
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124) 
        at android.os.Handler.handleCallback(Handler.java:883) 
        at android.os.Handler.dispatchMessage(Handler.java:100) 
        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 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
     Caused by: java.lang.SecurityException: getSerial: The user 10453 does not meet the requirements to access device identifiers.
        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:162)
        at com.squareup.android.util.ContextKt.getAndroidSerial(Context.kt:28)
        at com.squareup.android.util.AndroidUtilModule.provideAndroidSerial(AndroidUtilModule.kt:59)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.provideAndroidSerial(AndroidUtilModule_ProvideAndroidSerialFactory.java:37)
E/AndroidRuntime:     at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:27)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:9)
        at com.squareup.http.interceptor.RealSquareHeaders.createMutableHeaderList(RealSquareHeaders.java:143)
        at com.squareup.http.interceptor.RegisterHttpInterceptor.intercept(RegisterHttpInterceptor.java:44)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at shadow.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at shadow.okhttp3.RealCall.execute(RealCall.kt:66)
        at shadow.retrofit2.OkHttpCall.execute(OkHttpCall.java:188)
        at shadow.retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45)
        at io.reactivex.Observable.subscribe(Observable.java:12284)
        at shadow.retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34)
        at io.reactivex.Observable.subscribe(Observable.java:12284)
        at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers(TelephonyPermissions.java:437)
        at com.android.internal.telephony.TelephonyPermissions.checkPrivilegedReadPermissionOrCarrierPrivilegePermission(TelephonyPermissions.java:369)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:275)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:252)
        at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage(DeviceIdentifiersPolicyService.java:67)

@StephenJosey - UPDATE: Well, the demo app didn't work when I had manually updated the SDK versions to 29 (i.e. compileSdkVersion, buildToolsVersion, targetSdkVersion, and etc.) in the app-level Gradle file, but yes, it seems like the whole process works when targeting 28 after running on my API 29 device.

Unfortunately though, our app is targeting API 29 and it'd be somewhat problematic to downgrade to 28 to use this SDK properly ๐Ÿคทโ€โ™‚๏ธ

Thanks @davenotdavid for the update. Yes, this is a known thing; targeting above 28 won't work, but targeting 28 and running on 29 or above should work. I'll keep this post updated once we have more information on the ability to target 29 or above.

@StephenJosey - Thanks for the response. Do you by any chance think it'll be by the next Android 11 release (so third quarter of this year)?

Hey apologies for the delay. The latest release (1.3.9 - https://developer.squareup.com/docs/changelog/mobile-logs/2020-05-28) you are able to target API 29 now. Please let me know if you have any questions about this!

@StephenJosey - Thanks for getting back! Unfortunately, I'm still getting the same errors after pointing to v1.3.9 and even uninstalled the app/removed cache.

  • Crash logs after granting device permissions and then starting the checkout process:
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: com.angieslist.servicetown.sp.debug, PID: 19124
    java.lang.SecurityException: getSerial: The user 10517 does not meet the requirements to access device identifiers.
        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:162)
        at com.squareup.android.util.ContextKt.getAndroidSerial(Context.kt:28)
        at com.squareup.android.util.AndroidUtilModule.provideAndroidSerial(AndroidUtilModule.kt:59)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.provideAndroidSerial(AndroidUtilModule_ProvideAndroidSerialFactory.java:37)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:27)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:9)
        at com.squareup.http.interceptor.RealSquareHeaders.createMutableHeaderList(RealSquareHeaders.java:143)
        at com.squareup.http.interceptor.RegisterHttpInterceptor.intercept(RegisterHttpInterceptor.java:44)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at com.squareup.http.interceptor.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:31)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at com.squareup.http.interceptor.UrlRedirectInterceptor.intercept(UrlRedirectInterceptor.java:42)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at com.squareup.http.interceptor.ProfilingInterceptor.intercept(ProfilingInterceptor.java:24)
        at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
        at shadow.okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
        at shadow.okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers(TelephonyPermissions.java:437)
        at com.android.internal.telephony.TelephonyPermissions.checkPrivilegedReadPermissionOrCarrierPrivilegePermission(TelephonyPermissions.java:369)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:275)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:252)
        at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage(DeviceIdentifiersPolicyService.java:67)
  • Crash logs when trying to open the app:
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.angieslist.servicetown.sp.debug, PID: 20719
    java.lang.RuntimeException: Unable to create application com.angieslist.sp.DebugSPApp: java.lang.SecurityException: getSerial: The user 10517 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 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.SecurityException: getSerial: The user 10517 does not meet the requirements to access device identifiers.
        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:162)
        at com.squareup.android.util.ContextKt.getAndroidSerial(Context.kt:28)
        at com.squareup.android.util.AndroidUtilModule.provideAndroidSerial(AndroidUtilModule.kt:59)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.provideAndroidSerial(AndroidUtilModule_ProvideAndroidSerialFactory.java:37)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:27)
        at com.squareup.android.util.AndroidUtilModule_ProvideAndroidSerialFactory.get(AndroidUtilModule_ProvideAndroidSerialFactory.java:9)
        at com.squareup.log.CrashReportingLogger_Factory.get(CrashReportingLogger_Factory.java:90)
        at com.squareup.log.CrashReportingLogger_Factory.get(CrashReportingLogger_Factory.java:15)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.ProductionServerModule_ProvideApiUrlSelectorFactory.get(ProductionServerModule_ProvideApiUrlSelectorFactory.java:27)
        at com.squareup.ProductionServerModule_ProvideApiUrlSelectorFactory.get(ProductionServerModule_ProvideApiUrlSelectorFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.http.interceptor.UrlRedirectInterceptor_Factory.get(UrlRedirectInterceptor_Factory.java:35)
        at com.squareup.http.interceptor.UrlRedirectInterceptor_Factory.get(UrlRedirectInterceptor_Factory.java:10)
        at dagger.internal.SetFactory.get(SetFactory.java:126)
        at dagger.internal.SetFactory.get(SetFactory.java:37)
        at com.squareup.http.HttpReleaseModule_ProvideOkHttpClientBuilderFactory.get(HttpReleaseModule_ProvideOkHttpClientBuilderFactory.java:33)
        at com.squareup.http.HttpReleaseModule_ProvideOkHttpClientBuilderFactory.get(HttpReleaseModule_ProvideOkHttpClientBuilderFactory.java:12)
        at com.squareup.http.HttpModule_ProvideUnauthenticatedOkHttpClientFactory.get(HttpModule_ProvideUnauthenticatedOkHttpClientFactory.java:27)
        at com.squareup.http.HttpModule_ProvideUnauthenticatedOkHttpClientFactory.get(HttpModule_ProvideUnauthenticatedOkHttpClientFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedRetrofitFactory.get(RetrofitModule_ProvideUnauthenticatedRetrofitFactory.java:54)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedRetrofitFactory.get(RetrofitModule_ProvideUnauthenticatedRetrofitFactory.java:15)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.get(RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.java:28)
E/AndroidRuntime:     at com.squareup.server.RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.get(RetrofitModule_ProvideUnauthenticatedProtoServiceCreatorFactory.java:10)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at dagger.internal.DelegateFactory.get(DelegateFactory.java:36)
        at com.squareup.server.analytics.EventStreamModule_Prod_ProvideEventStreamServiceFactory.get(EventStreamModule_Prod_ProvideEventStreamServiceFactory.java:27)
        at com.squareup.server.analytics.EventStreamModule_Prod_ProvideEventStreamServiceFactory.get(EventStreamModule_Prod_ProvideEventStreamServiceFactory.java:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.analytics.Es1BatchUploader_Factory.get(Es1BatchUploader_Factory.java:24)
        at com.squareup.server.analytics.Es1BatchUploader_Factory.get(Es1BatchUploader_Factory.java:7)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.server.analytics.EventStreamModule_ProvideEventStreamFactory.get(EventStreamModule_ProvideEventStreamFactory.java:79)
        at com.squareup.server.analytics.EventStreamModule_ProvideEventStreamFactory.get(EventStreamModule_ProvideEventStreamFactory.java:16)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.analytics.EventStreamAnalytics_Factory.get(EventStreamAnalytics_Factory.java:39)
        at com.squareup.analytics.EventStreamAnalytics_Factory.get(EventStreamAnalytics_Factory.java:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.getReaderSdkAdditionalCrashLogger(DaggerReaderSdkReleaseAppComponent.java:2948)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.getSetOfCrashAdditionalLogger(DaggerReaderSdkReleaseAppComponent.java:2954)
        at com.squareup.DaggerReaderSdkReleaseAppComponent.exceptionHandlerDependencies(DaggerReaderSdkReleaseAppComponent.java:3631)
        at com.squareup.log.RegisterExceptionHandler.resolveDependencies(RegisterExceptionHandler.java:100)
        at com.squareup.RegisterAppDelegate.createAppScope(RegisterAppDelegate.java:358)
        at com.squareup.RegisterAppDelegate.onCreate(RegisterAppDelegate.java:216)
        at com.squareup.sdk.reader.internal.AppBootstrapHolder.onCreate(AppBootstrapHolder.java:23)
        at com.squareup.sdk.reader.ReaderSdk.initialize(ReaderSdk.java:38)
        at com.angieslist.sp.SPApp.onCreate(SPApp.kt:52)
        at com.angieslist.sp.DebugSPApp.onCreate(DebugSPApp.java:14)
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
        	... 8 more
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers(TelephonyPermissions.java:437)
        at com.android.internal.telephony.TelephonyPermissions.checkPrivilegedReadPermissionOrCarrierPrivilegePermission(TelephonyPermissions.java:369)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:275)
        at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:252)
        at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage(DeviceIdentifiersPolicyService.java:67)

Thanks for reporting, unfortunately we're seeing the same issue. Not sure what went wrong, but our team is definitely working on this. Would you be able to provide your application id in case we need to do a limited-release test?

@StephenJosey - com.angieslist.servicetown.sp.debug for our debug build

Sorry I meant your Square application id (from your Square developer dashboard)?

@StephenJosey - woops! Here it is:

sq0idp-T4SClu2rWV2AcYcEiHALXg

@StephenJosey - so it seems like the latest update v1.3.10 works, but I probably should've mentioned that the application ID I provided above was pointing to our "debug/staging" Square account Reader SDK creds, whereas we have another Square account for prod use.

While we test to see if this update also works on our prod Square account creds in the meantime, will this version theoretically work for that application ID as well? Or, will you need that ID as well as a form of whitelisting?

Thanks!

Great question! With the release of 1.3.10, it should work for all application ids (we just whitelisted yours to get it a few days early). Let me know if it's still not working of course, though.

@StephenJosey - so unfortunately, we weren't able to download the dependencies (pointing to our other Square account consisting of our prod creds (app ID: sq0idp-cyEZl-H328bxzEh0E4tq5w), whereas the debug/staging account works) both locally and on our CI. I guess for starters, what Gradle build versions did you guys end up testing against? We're currently on Android Gradle v3.4.1 and Gradle v5.1.1.

Locally:
Screen Shot 2020-06-24 at 4 29 44 PM

Circle CI:

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
   > Could not find com.squareup.sdk.reader:reader-sdk-*****************************:1.3.10.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://dl.google.com/dl/android/maven2/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://jcenter.bintray.com/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://jcenter.bintray.com/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://maven.fabric.io/public/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://maven.fabric.io/public/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://clojars.org/repo/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://clojars.org/repo/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://maven.google.com/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://maven.google.com/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://oss.sonatype.org/content/repositories/snapshots/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://oss.sonatype.org/content/repositories/snapshots/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://jitpack.io/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://jitpack.io/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://artifactory.angieslist.com/artifactory/snapshots/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://artifactory.angieslist.com/artifactory/snapshots/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://artifactory.angieslist.com/artifactory/releases/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://artifactory.angieslist.com/artifactory/releases/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
       - https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.pom
       - https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-*****************************/1.3.10/reader-sdk-*****************************-1.3.10.jar
     Required by:
         project :app

@StephenJosey I work w/ @davenotdavid on the Android team and I kind of second what he has going on with this discussion. I was able to get a great build using v1.3.10 on Android 9 and 10! Yay! That was for our teamQA appID... When moving to our productionId, I was getting that same runtime error and circle failure Dave presented above? I see that you say id's shouldn't matter to get successful builds on Android 9 & 10?

btw, I should have said this first, thanks for your quick responses!

Best,
RC

Doh, seems like 1.3.10 was pushed out in the docs but the SDK itself didn't actually get pushed out. Our Android team just confirmed that they pushed it out successfully a few moments ago, could you please try again? To confirm: it now should be available to everyone. Apologies for the confusion here.

@StephenJosey I have been running into leakcanary issues with the new ReaderSdk v1.3.10 on Android 10. I looked into your thread Could not create leak directory when device is running on Marshmallow.

For better context, I am able to have a successful payment on Android 10 but when closing app and reentering, I get this crash below. Do you see anything off the top of your head I may be doing wrong? Thanks for your time.
Screen Shot 2020-06-25 at 4 36 17 PM

@StephenJosey - yep, that push worked! Thanks a lot for this update ๐Ÿ‘