Hi,
I know the com.squareup.sdk.reader
is being deprecated. However, we do have a crash currently live with the 1.7.7 version (the latest as far as i can tell).
It appears random, as we have a customer with 5 Galaxy Tab tablets, and 3 of them work, while 2 don’t.
The Crash is as follows:
Exception java.lang.IllegalStateException:
at com.squareup.sdk.reader.internal.AppBootstrapHolder.getSdkFactory (AppBootstrapHolder.java:39)
at com.squareup.sdk.reader.ReaderSdk.authorizationManager (ReaderSdk.java:46)
at com.example.ourcompany.KioskManager$1.run (KioskManager.java:100)
at android.os.Handler.handleCallback (Handler.java:958)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8919)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
The line of code on our side is
AuthorizationManager authManager = ReaderSdk.authorizationManager();
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
Reader SDK Quickstart
Reader SDK Quickstart
Configure the Reader SDK Sample Application
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The crash you’re experiencing is likely due to the Reader SDK not being properly initialized before calling ReaderSdk.authorizationManager()
. The Reader SDK should be initialized in your application’s onCreate()
method before any other calls to the SDK are made.
If the SDK is not initialized properly, calling ReaderSdk.authorizationManager()
will result in an IllegalStateException
as the SDK factory has not been set up yet.
Please ensure that you have correctly initialized the Reader SDK in your application’s onCreate()
method. If the issue persists, it might be due to device-specific issues or other factors in your application’s lifecycle.
This answer was reviewed by @Bryan-Square.
I’ve checked my Application:
public class SquarePoweredApplication extends Application {
@Override public void onCreate() {
super.onCreate();
ReaderSdk.initialize(this);
}
}
and the android manifest
<application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name="com.example.ourcompany.SquarePoweredApplication">
This matches what is in: reader-sdk-android-quickstart/app/src/main/java/com/example/readersdk/ExampleApplication.java at master · square/reader-sdk-android-quickstart · GitHub
Did anything change recently. Were any updates made or dependency updates? Also what’s your application ID, location_id
, and the time of the most recent crash? 
No changes as far as the customer is concerned. Our last update got pushed in September.
The customer says “has 5 tablets (Samsung Galaxy Tabs) and 2 of them aren’t loading the app.”
- all tablets are the same, all purchased together
- when click on the app, it just won’t load
- have cleared cache
- reboot tablet
- uninstalled, reinstalled app, rebooted
- confirmed no OS updates pending
- just this morning stopped
Crash report is from Google Play. Shows “5 hours ago”. samsung gta8wifi (Galaxy Tab A8). Android 14 (SDK 34).
ApplicationId - do you want our package name as listed in google play?
location_id - I think this crash is occuring before the customer tries to register a location/reader. From the test above, it would occur before that.
I need the Square application ID and location_id
. As for the time it would have been 8:30am PST? 
Also it your app targeting Android 13? 
I am targeting sdk version 34
with a min version sdk of 25
. So the target is android 14.
I think this crash is happening when the customer opens the app. Before they can even try link a location. So I’m not sure how a location id would help in this scenario. Its also possible that this customer isn’t using Square at all… just that the Square SDK is crashing when our app first loads.
Square app id is sq0idp-aFQeyUMSNHQAvCgay07xPg
Currently, Reader SDK supports targeting Android 13. Here are our requirements and limitations. 
I think those docs are out of date…
See Google Play required SDK targeting being 34. Also see my last ticket, with version 1.7.7 of the Reader SDK be released to explicitly target 34, and meet this google play requirement.
Hmm, okay. Well the location_id
will be helpful if you could get that for us. 
Would you be able to elaborate on how a “location_id” would help? My understanding is that is the which enduser is trying to take payments with square. Its an identifier of their square merchant account / address. Or am I misunderstanding what “location_id” is?
In this crash, they never get a chance to even link their Square Merchant / account / location. Its crashing on app first load. Since it crashes before any user interaction with the Square UI… I don’t mean to be difficult, I just don’t see how that piece of information helps here
You have to authorize with a location_id
and the team is asking for it. So if it’s not provided the team won’t look any further into the issue. 
That’s the problem with this crash… its before they authorization a location. No UI is presented to the user before the app crashes due to the line AuthorizationManager authManager = ReaderSdk.authorizationManager();
I’m not sure how to share a location… if the user can’t see the UI to authorize a location…
Its done on app initialization so callbacks can be registered for later use…