Git Product home page Git Product logo

reader-sdk-android-quickstart's Introduction

Reader SDK Quick Start Sample Android App

Follow the Reader SDK Quick Start Guide to start taking cash and credit card payments with Reader SDK.

License

Copyright 2017 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Feedback

Rate this sample app here!

reader-sdk-android-quickstart's People

Contributors

armaxis avatar daphnechiu avatar ellapolo avatar fka3 avatar jonathannakhla-square avatar pyricau avatar whatsemo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reader-sdk-android-quickstart's Issues

Reader SDK Details For Non Us Residents

Is there a particular contact at square we can reach out to if we're integrating with the square reader SDK for our internationalised app but based in another country e.g Australia?

Essentially after some SDK details so we can do some testing for our US clients.

OnErrorNotImplementedException crash in 1.4.4 square library

I am using square library 1.4.4 targeting android 30 and this is a new crash, previously square payments worked. When I try to take a payment I get the following crash:

2021-04-08 16:28:54.012 11279-11279 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.beaconsoftco.dadrivermobile, PID: 11279
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.NoSuchMethodError: No direct method (Lkotlin/coroutines/CoroutineContext;I)V in class Lkotlinx/coroutines/flow/internal/ChannelFlow; or its super classes (declaration of 'kotlinx.coroutines.flow.internal.ChannelFlow' appears in /data/app/~~Ctz1_E6HrZFZOAFDfJvjAA==/com.beaconsoftco.dadrivermobile-BF-cKAraaR_u-46ZHRlN-w==/base.apk!classes7.dex)
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.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:79)
at kotlinx.coroutines.reactive.FlowSubscription.flowProcessing(ReactiveFlow.kt:187)
at kotlinx.coroutines.reactive.FlowSubscription$createInitialContinuation$$inlined$Continuation$1$lambda$1.invoke(ReactiveFlow.kt:175)
at kotlinx.coroutines.reactive.FlowSubscription$createInitialContinuation$$inlined$Continuation$1$lambda$1.invoke(ReactiveFlow.kt:166)
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$2.invokeSuspend(IntrinsicsJvm.kt:205)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:342)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith$default(DispatchedContinuation.kt:263)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:18)
at kotlinx.coroutines.reactive.FlowSubscription$createInitialContinuation$$inlined$Continuation$1.resumeWith(Continuation.kt:159)
at kotlinx.coroutines.reactive.FlowSubscription.request(ReactiveFlow.kt:230)
at io.reactivex.internal.subscribers.LambdaSubscriber.request(LambdaSubscriber.java:114)
at io.reactivex.internal.operators.flowable.FlowableInternalHelper$RequestMax.accept(FlowableInternalHelper.java:220)
at io.reactivex.internal.operators.flowable.FlowableInternalHelper$RequestMax.accept(FlowableInternalHelper.java:216)
at io.reactivex.internal.subscribers.LambdaSubscriber.onSubscribe(LambdaSubscriber.java:52)
at kotlinx.coroutines.reactive.FlowAsPublisher.subscribe(ReactiveFlow.kt:160)
at io.reactivex.internal.operators.flowable.FlowableFromPublisher.subscribeActual(FlowableFromPublisher.java:29)
at io.reactivex.Flowable.subscribe(Flowable.java:14935)
at io.reactivex.Flowable.subscribe(Flowable.java:14872)
at io.reactivex.Flowable.subscribe(Flowable.java:14760)
at com.squareup.cdx.payment.RealCardreaderPayments.initialize(RealCardreaderPayments.kt:77)
at com.squareup.cardreaders.CardreadersInitializer.onEnterScope(CardreadersInitializer.kt:36)
at shadow.mortar.MortarScope.register(MortarScope.java:199)
at com.squareup.LoggedInScopeRunner.onEnterScope(LoggedInScopeRunner.java:224)
at shadow.mortar.MortarScope.register(MortarScope.java:199)
at com.squareup.RegisterAppDelegate.onAuthenticated(RegisterAppDelegate.java:520)
at com.squareup.RegisterAppDelegate.lambda$onEnterScope$3$RegisterAppDelegate(RegisterAppDelegate.java:463)
at com.squareup.-$$Lambda$RegisterAppDelegate$vHZZqP35d8MKCMJt3awe2FQpeno.accept(Unknown Source:4)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.test(BehaviorRelay.java:364)
at com.jakewharton.rxrelay2.BehaviorRelay$BehaviorDisposable.emitNext(BehaviorRelay.java:358)
at com.jakewharton.rxrelay2.BehaviorRelay.accept(BehaviorRelay.java:135)
2021-04-08 16:28:54.013 11279-11279 E/AndroidRuntime: at com.squareup.account.FileBackedAuthenticator.onLoginResponse(FileBackedAuthenticator.kt:168)
at com.squareup.account.FileBackedAuthenticator.loggedIn(FileBackedAuthenticator.kt:119)
at com.squareup.sdk.reader.authorization.ReaderSdkAuthenticator$login$2$2.apply(ReaderSdkAuthenticator.kt:136)
at com.squareup.sdk.reader.authorization.ReaderSdkAuthenticator$login$2$2.apply(ReaderSdkAuthenticator.kt:62)
at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:57)
at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64)
at io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess(SingleMap.java:64)
at io.reactivex.internal.operators.single.SingleCreate$Emitter.onSuccess(SingleCreate.java:67)
at kotlinx.coroutines.rx2.RxSingleCoroutine.onCompleted(RxSingle.kt:59)
at kotlinx.coroutines.AbstractCoroutine.onCompletionInternal(AbstractCoroutine.kt:104)
at kotlinx.coroutines.JobSupport.tryFinalizeSimpleState(JobSupport.kt:294)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:853)
at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:825)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:111)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8506)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

Android Reader SDK Support for Android 10 and Above

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?

Maintain Separate SDK's for debug and release

I want to be able to use development and production sdk for debug and release. I was unable to get it to work since the dependency is based on the square application id and even has different credentials for development and production.

Can someone give me an example on how i differentiate them in gradle.

Reader SDK v1.7.5 conflicts with Zendesk SDK

New version of reader SDK (1.7.5) conflicts with zendesk SDK in the permission section.

Manifest merger failed : Attribute uses-permission#android.permission.READ_EXTERNAL_STORAGE@maxSdkVersion value=(31) from [com.squareup.sdk.reader:reader-sdk-665373fc:1.7.5] AndroidManifest.xml:67:9-35
  	is also present at [com.zendesk.belvedere2:belvedere:3.0.5] AndroidManifest.xml:18:9-35 value=(32).
  	Suggestion: add 'tools:replace="android:maxSdkVersion"' to <uses-permission> element at AndroidManifest.xml:65:5-67:38 to override.

Androidx support for Reader SDK

I am unable to use androidx with square reader sdk. I see that square is still using old support libraries. Is this change going to happen soon?

Reader SDKs for Debug and Release Environments

Similar to this question without it being addressed (where instead, we have two production Square accounts each pointing to a debug and release environment): #8

^ with that in mind, is it possible to download the Reader SDK dependencies from the repository based on build types when authorizing into it with respective credentials (i.e. our debug/dev creds pointing to a production Square account's Reader SDK, and the release creds pointing to another production Square account's Reader SDK in this case) via the same repository URL? Because, I'm not really seeing any documentation on this as of now.

Here's the relevant parts of the app level build.gradle file:

...

final SQUARE_READER_SDK_APP_ID_DEV = 'sq0idp-T4SClu2rWV2AcYcEiHALXg'
final SQUARE_READER_SDK_APP_ID_PROD = 'sq0idp-cyEZl-H328bxzEh0E4tq5w'
final SQUARE_READER_SDK_VERSION = "1.3.6"

...

buildTypes {
    debug {
        ...

        repositories {
            maven {
                url "https://sdk.squareup.com/android"
                credentials {
                    username SQUARE_READER_SDK_APP_ID_DEV
                    // Set as a property from CI command with one of its env vars
                    password squareReaderSdkPasswordDev
                }
            }
        }

    }
    release {
        ... 

        repositories {
            maven {
                url "https://sdk.squareup.com/android"
                credentials {
                    username SQUARE_READER_SDK_APP_ID_PROD
                    // Set as a property from CI command with one of its env vars
                    password squareReaderSdkPasswordProd
                }
            }
        }
    }
}

...

dependencies { 
    ...

    debugImplementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APP_ID_DEV:$SQUARE_READER_SDK_VERSION"
    releaseImplementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APP_ID_PROD:$SQUARE_READER_SDK_VERSION"
    runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:$SQUARE_READER_SDK_VERSION"
    
    ...
}

...

Note that building this locally (via Gradle builds and the ./gradlew androidDependencies task) works properly, but not our CI as mentioned in my SO post: https://stackoverflow.com/questions/61240438/execution-failed-for-task-appandroiddependencies-on-circle-ci-but-not-locall

^ but it passes on CI when only downloading the dependency from one build type (i.e.
temporarily commenting out the release creds to only get the debug one, but doesn't work simultaneously
)

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

I am getting this error, I have no issues with my network:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

This is a more detailed error:

`1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.squareup.sdk.reader:reader-sdk-{Application ID I hide it}g:1.7.4.
Searched in the following locations:`

How does Manual Card Entry (Reader SDK) really work?

As opposed to using Square Readers, I was wondering how manual card entries really work under the hood as part of the Reader SDK. To be exact, adding a manual card entry option - the AdditionalPaymentType.MANUAL_CARD_ENTRY enum - into the checkout params (as a Set arg instead) during the checkout process.

Based on the screenshots below, you'll see that a "Card Swiped" message appears at the top with it not really outputting any results (i.e. logs nor it appearing as a transaction within the Square dashboard - whereas other payment types like cash, check, and etc. show up) - is this message really only intended, or do I have to hit a certain API for this to fully process and see actual results?:

Screenshot_20200124-101208
Screenshot_20200124-101217
Screenshot_20200124-101449

SecurityException: Permission Denial: requires android.permission.FOREGROUND_SERVICE

library causes following exceptions because of Apps that target Android 9 (API level 28) or higher and use foreground services must request the FOREGROUND_SERVICE permission. This is a normal permission, so the system automatically grants it to the requesting app.

If an app that targets API level 28 or higher attempts to create a foreground service without requesting FOREGROUND_SERVICE, the system throws a SecurityException.

java.lang.RuntimeException: Unable to create service com.squareup.cardreader.dipper.FirmwareUpdateNotificationService: java.lang.SecurityException: Permission Denial: startForeground from pid=21256, uid=10358 requires android.permission.FOREGROUND_SERVICE

Caused by: java.lang.SecurityException: Permission Denial: startForeground from pid=21256, uid=10358 requires android.permission.FOREGROUND_SERVICE

Android 10 - BootReceiver RuntimeException

Happy new year!

We are keep getting randomly an exception from square reader version readerSdkVersion = "1.5.6" on ELO Android 10

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.squareup.queue.QueueService$BootReceiver: java.lang.NullPointerException: appContextWrapper must not be null
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3798)
       at android.app.ActivityThread.access$1400(ActivityThread.java:220)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1871)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7397)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

Android 10 crashes on some devices

Hello thanks for all your work in getting the reader sdk setup for Android 10 (#29). Since implementing that we've been seeing a lot of crashes on Samsung and LG devices. I was able to track down it being the square sdk by not using or initializing the sdk and it caused the crashes to stop.

signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.angieslist.servicetown.sp <<<

backtrace:
  #00  pc 00000000001ebcd0  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/lib/arm64/libregister.so
  #01  pc 0000000000415560  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/lib/arm64/libregister.so
  #02  pc 0000000000306b1c  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/lib/arm64/libregister.so
  #03  pc 00000000006593b0  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/lib/arm64/libregister.so (JNI_OnLoad+48028)
  #04  pc 0000000000378ee0  /apex/com.android.runtime/lib64/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*, _jclass*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+3232)
  #05  pc 00000000000050e8  /apex/com.android.runtime/lib64/libopenjdkjvm.so (JVM_NativeLoad+412)
  #06  pc 00000000000b9af4  /system/framework/arm64/boot.oat (art_jni_trampoline+228)
  #07  pc 00000000000d6bfc  /system/framework/arm64/boot.oat (java.lang.Runtime.loadLibrary0+236)
  #08  pc 00000000000d7be4  /system/framework/arm64/boot.oat (java.lang.Runtime.loadLibrary0+180)
  #09  pc 00000000000dc7c0  /system/framework/arm64/boot.oat (java.lang.System.loadLibrary+96)
  #10  pc 00000000001375b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568)
  #11  pc 000000000014608c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276)
  #12  pc 00000000002e169c  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
  #13  pc 00000000002dc97c  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912)
  #14  pc 000000000059d75c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+368)
  #15  pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
  #16  pc 0000000002fb0c54  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/oat/arm64/base.vdex (shadow.com.getkeepsafe.relinker.SystemLibraryLoader.loadLibrary)
  #17  pc 000000000059c6b4  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1740)
  #18  pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20)
  #19  pc 0000000002fb08be  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/oat/arm64/base.vdex (shadow.com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal+54)
  #20  pc 000000000059d250  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
  #21  pc 0000000000131914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
  #22  pc 0000000002fb070c  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/oat/arm64/base.vdex (shadow.com.getkeepsafe.relinker.ReLinkerInstance.access$000)
  #23  pc 000000000059da5c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
  #24  pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
  #25  pc 0000000002fb0518  /data/app/com.angieslist.servicetown.sp-_XB9lHZ41Y8qAKMnqhX7qA==/oat/arm64/base.vdex (shadow.com.getkeepsafe.relinker.ReLinkerInstance$1.run+16)
  #26  pc 00000000002b22e8  /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.8535840774985554900)+240)
  #27  pc 000000000058c1b8  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
  #28  pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
  #29  pc 00000000001a50b8  /system/framework/arm64/boot.oat (java.lang.Thread.run+72)
  #30  pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
  #31  pc 000000000014606c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
  #32  pc 00000000004ac4b8  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
  #33  pc 00000000004ad54c  /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416)
  #34  pc 00000000004ed2e8  /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176)
  #35  pc 00000000000e205c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
  #36  pc 0000000000084af0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Running with a device locally I am able to get the following stacktrace

2020-06-25 09:01:19.082 27361-27361/? A/DEBUG: Build fingerprint: 'samsung/a50ue/a50:10/QP1A.190711.020/A505U1UES6BTE1:user/release-keys'
2020-06-25 09:01:19.082 27361-27361/? A/DEBUG: Revision: '10'
2020-06-25 09:01:19.082 27361-27361/? A/DEBUG: ABI: 'arm64'
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG: Timestamp: 2020-06-25 20:01:19+0700
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG: pid: 27262, tid: 27322, name: Thread-10  >>> com.angieslist.servicetown.sp.debug <<<
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG: uid: 10215
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x73e4093014
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG: Cause: execute-only (no-read) memory access error; likely due to data in .text.
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x0  00000072defa0008  x1  00000073e4093378  x2  0000000000000000  x3  0000000000000000
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x4  00000000ffffffff  x5  0000000000000000  x6  0000000000000080  x7  ff63606e4b6d4e5e
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x8  00000073e4093014  x9  00000072dd4c627c  x10 0000000000000002  x11 0000000000000000
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x12 0000000000000000  x13 0000000000000000  x14 000000000000ffff  x15 00000010bca4c000
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x16 00000072dd8fcc00  x17 00000073e6422048  x18 00000010bca4c000  x19 00000073e4093000
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x20 00000072def9b038  x21 00000072def99f30  x22 0000000055ab8ccc  x23 0000000055ab8ccc
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x24 00000073e4093000  x25 000000734bca6440  x26 ffffffffffffffff  x27 00000073e89df1c0
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     x28 00000072def9af37  x29 00000072def9b360
2020-06-25 09:01:19.083 27361-27361/? A/DEBUG:     sp  00000072def99e90  lr  00000072dd4c58e4  pc  00000072dd4c628c

The information I can find related to this issue is related to something new in Android 10.
https://developer.android.com/about/versions/10/behavior-changes-all#xom-binaries

Is the square reader sdk when initializing the sdk trying to do some binary memory inspection? If so I think this will cause issues on Android 10 devices.

How can I get the reader's SN

Hi guy,
Is there anyway to get the reader's serial number (S/N) or some other unique number by the SDK?

Looking forward!

Could not find Reader SDK from Maven for a Square account

Not sure where to ask this question, so I'll try here for starters.

After following the steps (particularly steps 1-2) for installing the Reader SDK for Android from the docs, we noticed a strange issue with retrieving the dependencies from Maven. We have two Square accounts (one for the dev environment, and the other for prod) that are both set to "Production Settings" instead of sandbox, neither account is activated, and only one of our Square accounts' (our "prod" one in this case) Reader SDK credentials work for getting the Reader SDK dependency. Why is it that our other account's application ID and repository password can't get us the proper aar for the Reader SDK? Note that we get the same failed results even in this reader-sdk-android-quickstart project after plugging in the creds into the gradle.properties file.

Here's the build failure when trying to sync with Gradle:
image

Here's the failure when running the task locally (in which we're wondering why a jar file is trying to be retrieved when Maven only has aar and pom files in the SDK's maven repo even though our "prod" one works despite not having a jar file as well?):

./gradlew app:androidDependencies
Parallel execution is an incubating feature.

> Configure project :app

...

> Task :app:androidDependencies
debug

> Task :app:androidDependencies FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:androidDependencies'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
   > Could not find reader-sdk-sq0idp-T4SClu2rWV2AcYcEiHALXg.jar (com.squareup.sdk.reader:reader-sdk-sq0idp-T4SClu2rWV2AcYcEiHALXg:1.3.6).
     Searched in the following locations:
         https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-sq0idp-T4SClu2rWV2AcYcEiHALXg/1.3.6/reader-sdk-sq0idp-T4SClu2rWV2AcYcEiHALXg-1.3.6.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 7s
1 actionable task: 1 executed

Here's the maven repo for the SDK pointing to our "dev" environment, and does this look right to you?:
image
image

Configurations for Android Product Flavors

Hi!
It would be great if there was an example of how to use SDK with different credentials for different product flavors.

The application can be styled and configured for different clients. For iOS I use for this different targets in Xcode and, accordingly, different frameworks. For Android - productFlavors, but I can't figure out, how to set up different SDK credentials for different productFlavors.

productFlavors {
        app1 {}
        app2 {}
    }

maven {
            url "https://sdk.squareup.com/android"
            credentials {
                username SQUARE_READER_SDK_APPLICATION_ID
                password SQUARE_READER_SDK_REPOSITORY_PASSWORD
            }
        }

App crashes on Q Beta 1

I realize Q Beta 1 was announced only a few days back but when I run this sample on an Android Q Emulator, the app crashes with the following stack trace:

2019-03-21 08:49:22.607 10323-10323/com.example.readersdk E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.readersdk, PID: 10323 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.IllegalArgumentException: Invalid primitive conversion from long to int 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.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:3438) 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:119) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:209) at android.app.ActivityThread.main(ActivityThread.java:7021) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:486) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872) 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.IllegalArgumentException: Invalid primitive conversion from long to int at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$2$2.apply(ReceivedResponse.kt:167) at com.squareup.receiving.ReceivedResponse$Companion$receiveFromRetrofit$2$2.apply(ReceivedResponse.kt:105) 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:119)  at android.os.Handler.handleCallback(Handler.java:873)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:209)  at android.app.ActivityThread.main(ActivityThread.java:7021)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:486)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)  Caused by: java.lang.IllegalArgumentException: Invalid primitive conversion from long to int at java.lang.reflect.Field.getInt(Native Method) at com.squareup.util.Telephony.<init>(Telephony.java:30) at com.squareup.util.Telephony_Factory.get(Telephony_Factory.java:21) at com.squareup.util.Telephony_Factory.get(Telephony_Factory.java:8) at com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get(AndroidModule_ProvideNetworkTypeFactory.java:21) at com.squareup.util.AndroidModule_ProvideNetworkTypeFactory.get(AndroidModule_ProvideNetworkTypeFactory.java:8) at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) at com.squareup.server.RegisterHttpInterceptor.intercept(RegisterHttpInterceptor.java:42) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at com.squareup.http.GzipRequestInterceptor.intercept(GzipRequestInterceptor.java:32) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) 2019-03-21 08:49:22.608 10323-10323/com.example.readersdk E/AndroidRuntime: at com.squareup.server.ProfilingInterceptor.intercept(ProfilingInterceptor.java:24) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147) at shadow.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121) at shadow.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254) at shadow.okhttp3.RealCall.execute(RealCall.java:92) at shadow.retrofit2.OkHttpCall.execute(OkHttpCall.java:186) at shadow.retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:45) at io.reactivex.Observable.subscribe(Observable.java:12090) at shadow.retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:34) at io.reactivex.Observable.subscribe(Observable.java:12090) 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:914)

Duplicate class in in-app purchase and reader-sdk

We got "Duplicate class com.squareup.Pan found in modules jetified-card-42.jar (com.squareup.android:card:42) and jetified-reader-sdk-internals-1.5.1.jar (com.squareup.sdk.reader:reader-sdk-internals:1.5.1)" error when building our project which support Square in-app purchase and reader SDK.

We can get through this error by adding exclude statement:

    implementation("com.squareup.sdk.in-app-payments:card-entry:1.5.0") {
        exclude group : 'com.squareup.android',module:'card'
    }

However it will crash when taking payment with in-app purchase.

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/Card$Brand;
        at sqip.internal.CardEditorState.<init>(CardEditorState.kt:23)
        at sqip.internal.BaseCardEntryActivity.onCreate(BaseCardEntryActivity.kt:119)
        at sqip.internal.CardEntryActivity.onCreate(CardEntryActivity.kt:38)
        at android.app.Activity.performCreate(Activity.java:8183)
        at android.app.Activity.performCreate(Activity.java:8167)

Please help resolve this issue.

Reader SDK crashes on target SDK 34

With target SDK 34 app crashes with following error

E/AndroidRuntime(10400): java.lang.RuntimeException: Unable to resume activity {com.example.example/com.squareup.ui.main.ApiMainActivity}: java.lang.SecurityException: com.example.example: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
E/AndroidRuntime(10400): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4962)
E/AndroidRuntime(10400): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4995)
E/AndroidRuntime(10400): 	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
E/AndroidRuntime(10400): 	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
E/AndroidRuntime(10400): 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
E/AndroidRuntime(10400): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
E/AndroidRuntime(10400): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
E/AndroidRuntime(10400): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(10400): 	at android.os.Looper.loopOnce(Looper.java:205)
E/AndroidRuntime(10400): 	at android.os.Looper.loop(Looper.java:294)
E/AndroidRuntime(10400): 	at android.app.ActivityThread.main(ActivityThread.java:8177)
E/AndroidRuntime(10400): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10400): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime(10400): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/AndroidRuntime(10400): Caused by: java.lang.SecurityException: com.example.example: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
E/AndroidRuntime(10400): 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
E/AndroidRuntime(10400): 	at android.os.Parcel.createException(Parcel.java:3041)
E/AndroidRuntime(10400): 	at android.os.Parcel.readException(Parcel.java:3024)
E/AndroidRuntime(10400): 	at android.os.Parcel.readException(Parcel.java:2966)
E/AndroidRuntime(10400): 	at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
E/AndroidRuntime(10400): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(10400): 	at shadow.leakcanary.ServiceWatcher$install$4$2.invoke(ServiceWatcher.kt:93)
E/AndroidRuntime(10400): 	at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
E/AndroidRuntime(10400): 	at $Proxy4.registerReceiverWithFeature(Unknown Source)
E/AndroidRuntime(10400): 	at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
E/AndroidRuntime(10400): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
E/AndroidRuntime(10400): 	at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
E/AndroidRuntime(10400): 	at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
E/AndroidRuntime(10400): 	at com.squareup.ui.MediaButtonDisabler.onResume(MediaButtonDisabler.java:38)
E/AndroidRuntime(10400): 	at com.squareup.ui.SquareActivity.onResume(SquareActivity.java:470)
E/AndroidRuntime(10400): 	at com.squareup.ui.main.MainActivity.onResume(MainActivity.java:205)
E/AndroidRuntime(10400): 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1603)
E/AndroidRuntime(10400): 	at android.app.Activity.performResume(Activity.java:8743)
E/AndroidRuntime(10400): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4952)
E/AndroidRuntime(10400): 	... 13 more
E/AndroidRuntime(10400): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(10400): 	at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:13927)
E/AndroidRuntime(10400): 	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2570)
E/AndroidRuntime(10400): 	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2720)
E/AndroidRuntime(10400): 	at android.os.Binder.execTransactInternal(Binder.java:1339)
E/AndroidRuntime(10400): 	at android.os.Binder.execTransact(Binder.java:1275)

Reader SDK card_transaction_already_in_progress

I am getting this error when launching checkout.

card_transaction_already_in_progress

A checkout operation is already in progress and a card has been presented for payment. Ensure that the in-progress checkout is complete before calling CheckoutManager#startCheckoutActivity again.

What am i doing wrong? How do i check if any payment is in progress? I am making sure to launch checkout only once and still keep getting this error.

Reader SDK initialise error in one plus 6t Android version 10

  1. java.lang.SecurityException: get serial: The user 10318 does not meet the requirements to access device identifiers.

2.com.squareup.EventStreamModule_Prod_ProvideEventStreamServiceFactory.get(EventStreamModule_Prod_ProvideEventStreamServiceFactory.java)

These errors raise while I initialize the square reader in my application.
can you please provide me a better solution to handle this error?

I am using the latest SDK for the square reader.
implementation 'com.squareup.sdk.reader:reader-sdk-Key:1.3.5'
runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:1.3.5"

Immersive (full screen) mode for checkoutManager.startCheckoutActivity

Hello.
I'm using the SDK in the app working in Immersive mode. On full screen activity I call:

checkoutManager.startCheckoutActivity(this, params.build());

Checkout activity appears with notification bar and other android controls shown.
Is there a way to start checkout activity fullscreen also?
I use currently latest version of reader sdk, 1.0.4.

Adding firebase crash the sample app

I want to use reader sdk and firebase for my project. It seems like the Reader SDK library conflicts with firebase. As soon as I added this to the gradle build:

implementation 'com.google.firebase:firebase-core:16.0.4'

This example app crash with this error
2018-11-06 23:12:07.299 8920-8920/com.example.readersdk E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.readersdk, PID: 8920 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf; at com.google.android.gms.safetynet.SafetyNet.<clinit>(Unknown Source) at com.google.android.gms.safetynet.SafetyNet.getClient(Unknown Source) at com.squareup.safetynet.SafetyNetModule.getClient(SafetyNetModule.java:18) at com.squareup.safetynet.SafetyNetModule_GetClientFactory.get(SafetyNetModule_GetClientFactory.java:24) at com.squareup.safetynet.SafetyNetModule_GetClientFactory.get(SafetyNetModule_GetClientFactory.java:10) at com.squareup.safetynet.SafetyNetWrapper_Factory.get(SafetyNetWrapper_Factory.java:38) at com.squareup.safetynet.SafetyNetWrapper_Factory.get(SafetyNetWrapper_Factory.java:10) at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) at com.squareup.safetynet.SafetyNetRunner_Factory.get(SafetyNetRunner_Factory.java:39) at com.squareup.safetynet.SafetyNetRunner_Factory.get(SafetyNetRunner_Factory.java:10) at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) at com.squareup.LoggedInScopeRunner_Factory.get(LoggedInScopeRunner_Factory.java:269) at com.squareup.LoggedInScopeRunner_Factory.get(LoggedInScopeRunner_Factory.java:50) at dagger.internal.DoubleCheck.get(DoubleCheck.java:47) at com.squareup.DaggerReaderSdkReleaseAppComponent$ReaderSdkReleaseLoggedInComponentImpl.loggedInScopeRunner(DaggerReaderSdkReleaseAppComponent.java:8306) at com.squareup.RegisterAppDelegate.onAuthenticated(RegisterAppDelegate.java:575) at com.squareup.RegisterAppDelegate$2.onLoggedIn(RegisterAppDelegate.java:541) at com.squareup.account.FileBackedAuthenticator.load(FileBackedAuthenticator.java:127) at com.squareup.RegisterAppDelegate.loadAuthenticator(RegisterAppDelegate.java:530) at com.squareup.RegisterAppDelegate.onEnterScope(RegisterAppDelegate.java:493) at shadow.mortar.MortarScope.register(MortarScope.java:199) at com.squareup.RegisterAppDelegate.createAppScope(RegisterAppDelegate.java:367) at com.squareup.RegisterAppDelegate.onCreate(RegisterAppDelegate.java:210) at com.squareup.sdk.reader.internal.AppBootstrapHolder.onCreate(AppBootstrapHolder.java:23) at com.squareup.sdk.reader.ReaderSdk.initialize(ReaderSdk.java:37) at com.example.readersdk.ExampleApplication.onCreate(ExampleApplication.java:14) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5503) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6251) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)

Connect button is not rendering in Settings activity

Steps:

  • build example app
  • authorize SDK
  • open Reader settings screen

Expected behavior
Connect button present

Current behavior
Connect button is missing

Android: 13
Device: Pixel 4 simulator, Pixel 5 real device
Reader SDK: 1.7.1

All works fine with 1.6.2

Screenshot_20220928_140306

Required Reinstallation

Hi Square Team,

I am trying to connect with device. it's connecting fine with your demo. for my app it's showing Required Reinstallation.

Can you please help me why I am getting this issue? I think any versioning issue.

Thanks,
Amit

Signature during checkout doesn't seem to work

With/without a Square Reader device (contactless/chip and magstripe) on-hand, I was wondering how to get signature collections to work during the checkout process. Or, are signatures only intended for transactions done with card swipes via Square Readers?

I've set the boolean flag to true (params.collectSignature(true);) prior to launching a cash transaction (and manual card entries, but to no avail as mentioned in this issue) with the following code:

private void startCheckout(Money checkoutAmount) {
    if (waitingForActivityStart) {
      return;
    }
    waitingForActivityStart = true;

    CheckoutManager checkoutManager = ReaderSdk.checkoutManager();
    CheckoutParameters.Builder params = CheckoutParameters.newBuilder(checkoutAmount);
    // TODO: Signatures still don't seem to be shown even with the following
    params.collectSignature(true);
    Set<AdditionalPaymentType> payments = new HashSet<>();
    payments.add(AdditionalPaymentType.MANUAL_CARD_ENTRY);
    payments.add(AdditionalPaymentType.CASH);
    payments.add(AdditionalPaymentType.OTHER);
    params.additionalPaymentTypes(payments);
    params.note("Testing note...");
    checkoutManager.startCheckoutActivity(this, params.build());
}

... where it just takes me directly straight to the "Transaction Complete" screen instead:
Screenshot_20200123-115313

Android 12 - ReaderSDK - parameter exported in AndroidManifest.xml

We are using Square ReaderSDK library for implementing communication of Reader with our Point of Sale Android application. We set these two fields for the building of the app to the latest version, because of the need of other libraries, which are requiring it for the correct working:

compileSdkVersion 31
buildToolsVersion 31

Then we also implemented latest Square libs for the above functionality:
implementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:1.5.1"
runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:1.5.1"

Unfortunately, once we tried to build the app even for debug purposes, we received the error message:
Manifest merger failed : android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See <activity> | Android Developers 1 for details.

We found, that it’s caused by missing the field android:exported for any component in AndroidManifest.xml file which includes parameter with the body. So we went through the merged manifest (once we decreased/reverted the build version and tried to find which components are missing this field and are blocking us from success building). And it looks like, that this files defined within dependent libraries are missing it:

com.squareup.ui.ApiActivity
com.squareup.ui.LocationActivity
com.squareup.ui.main.ApiMainActivity
com.squareup.queue.QueueService$BootReceiver
com.squareup.notification.LocaleChangeReceiver
com.squareup.cardreader.ble.lock.PosMarkerReceiver

Is there a possibility to add that exported field into this SquareReaderSDK library with also all their dependencies so that it will support also the latest Android version 12 (build version code 31)?

Conflicting error

Hi!

I get this error when I use Product Flavors
INSTALL_FAILED_CONFLICTING_PROVIDER

productFlavors {
        ver1 {
            flavorDimensions "environment"
            applicationIdSuffix ". ver1"
            versionNameSuffix "-ver1"
        }
        ver2 {
            flavorDimensions "environment"
            applicationIdSuffix ". ver2"
            versionNameSuffix "-ver2"
        }
    }

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
        sqipVersion = "1.1.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
    }
}

error

App crashes on sleep

When the android device goes to sleep, there is a reader sdk crash.

Fatal Exception: com.squareup.cardreader.CardReaderAssertException: /project/android/cardreader-native/src/main/jni/cardreader/src/comms/cr_comms_app.c:503. Condition: fail. Message: Message decryption failed with result 14 at com.squareup.cardreader.lcr.BleBackendNativeJNI.ble_received_data_from_characteristic_data(BleBackendNativeJNI.java) at com.squareup.cardreader.lcr.BleBackendNative.ble_received_data_from_characteristic_data(BleBackendNative.java:30) at com.squareup.cardreader.lcr.BleBackendNativePassthrough.ble_received_data_from_characteristic_data(BleBackendNativePassthrough.java:32) at com.squareup.cardreader.ble.BleBackend.lambda$onDataReceived$1(BleBackend.java:115) at com.squareup.cardreader.ble.BleBackend$$Lambda$2.run(Unknown Source:4) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) at com.squareup.cardreader.GlobalCardReaderModule$1$1.run(GlobalCardReaderModule.java:76)

Square Chip Reader Disconnecting

The square chip reader keep disconnecting when there is inactivity for like an hour or so. Documentation says it disconnects after 2 hours of inactivity. Pressing the power button on the chip reader doesn't connect the reader. I have to restart the app to reconnect it.

We are building a solution which requires square reader to always be connected. Is there anything i can do to keep the connection alive? If there is support to keep alive right now, is that something your team will consider adding? Is there any other way i can keep the connection alive?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.