Square SDK crashing in flutter android with API 32

E/MethodChannel#square_reader_sdk(19763): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/MethodChannel#square_reader_sdk(19763): at com.squareup.sdk.reader.internal.AppBootstrapHolder.loadAppBootstrapFactory(AppBootstrapHolder.java:30)
E/MethodChannel#square_reader_sdk(19763): … 16 more
E/MethodChannel#square_reader_sdk(19763): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
E/flutter (19763): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method ‘’ was called on null.
E/flutter (19763): Receiver: null
E/flutter (19763): Tried calling:
E/flutter (19763): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
E/flutter (19763): #1 ReaderSdk.isAuthorized

Please check above error and help me for this. i am stuck from one week in this. all set proper but still its giving error and not going further after giving permission

here is my configuration:

[✓] Flutter (Channel stable, 3.7.1, on macOS 13.0.1 22A400 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.77.0)
[✓] HTTP Host Availability

I noticed locale en-IN. Where are you trying to build the SDK? :slightly_smiling_face:

My location is in india but trying build app for USA.

example is working fine but when try to implement in our app that time facing above error in android only. in ios it also works fine.
Please have a look error and let me know what is best way to fix this.

Thanks.

Looking at your configurations it looks like your targeting Android 33. Our requirements for Android at this time are:

  • Your application targetSdkVersion is API 31 (Android 12) or earlier.
  • Your application compileSdkVersion is 32.
    :slightly_smiling_face:

yes because other dependency required compileSdkVersion 33 so need to set 33. when targetSdkVersion i also set 31 as well but still getting same error. so what is the solution for this? please let me know or we can do by remote if you are available.

Thanks.

We don’t yet support 33. Are the other dependencies able to compile at 33 but you have the SDK compile at 32? The team is working on supporting 33 however we don’t yet have a public release date. :slightly_smiling_face:

i set 32 and tried but still getting error.
i have set below configuration.
compileSdkVersion 32
minSdkVersion 24
targetSdkVersion 31

Please check below error:

E/MethodChannel#square_reader_sdk(24413): Failed to handle method call
E/MethodChannel#square_reader_sdk(24413): java.lang.RuntimeException: java.lang.ClassNotFoundException: com.squareup.AppBootstrapFactory
E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.internal.AppBootstrapHolder.loadAppBootstrapFactory(AppBootstrapHolder.java:33)
E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.internal.AppBootstrapHolder.onCreate(AppBootstrapHolder.java:21)
E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.ReaderSdk.initialize(ReaderSdk.java:38)
E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.flutter.SquareReaderSdkFlutterPlugin.initializeReaderSdk(SquareReaderSdkFlutterPlugin.java:160)
E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.flutter.SquareReaderSdkFlutterPlugin.onMethodCall(SquareReaderSdkFlutterPlugin.java:79)
E/MethodChannel#square_reader_sdk(24413): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#square_reader_sdk(24413): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#square_reader_sdk(24413): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#square_reader_sdk(24413): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#square_reader_sdk(24413): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#square_reader_sdk(24413): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#square_reader_sdk(24413): at android.os.Looper.loopOnce(Looper.java:201)
E/MethodChannel#square_reader_sdk(24413): at android.os.Looper.loop(Looper.java:288)
E/MethodChannel#square_reader_sdk(24413): at android.app.ActivityThread.main(ActivityThread.java:7842)
E/MethodChannel#square_reader_sdk(24413): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#square_reader_sdk(24413): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/MethodChannel#square_reader_sdk(24413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/MethodChannel#square_reader_sdk(24413): Caused by: java.lang.ClassNotFoundException: com.squareup.AppBootstrapFactory
E/MethodChannel#square_reader_sdk(24413): at java.lang.Class.classForName(Native Method)
E/MethodChannel#square_reader_sdk(24413): at java.lang.BootClassLoader.findClass(ClassLoader.java:1358)

E/MethodChannel#square_reader_sdk(24413): at java.lang.BootClassLoader.loadClass(ClassLoader.java:1418)

E/MethodChannel#square_reader_sdk(24413): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

E/MethodChannel#square_reader_sdk(24413): at com.squareup.sdk.reader.internal.AppBootstrapHolder.loadAppBootstrapFactory(AppBootstrapHolder.java:30)

E/MethodChannel#square_reader_sdk(24413): … 16 more

E/MethodChannel#square_reader_sdk(24413): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

E/flutter (24413): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: NoSuchMethodError: The method ‘’ was called on null.

E/flutter (24413): Receiver: null

E/flutter (24413): Tried calling:

What’s your location_id that your using? :slightly_smiling_face:

location_id means? my location is india

Hello,

Any update? Please let me know

Whats your Square generated location_id and your application ID? :slightly_smiling_face:

Here is my location id: L0118Z5276W1Y and App id: sandbox-sq0idb-33QPpvOhrYLEKDhdMsw_0A

Sorry for late reply.