square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK
Apache License 2.0
117 stars 36 forks source link

authorizeAsync crashes app (ANDROID) #56

Closed claudeaparecio closed 5 years ago

claudeaparecio commented 5 years ago

The app works perfectly fine when the authCode that is executed in authorizeAsync is incorrect or expired, but when it is correct the app crashes indefinitely. I saw another issue which is identical with this one ( #19 ) but it was on IOS. I have attached the logcat for this bug. I am looking forward for any help. Thanks a lot.

hukid commented 5 years ago

@claude39 Where did you attach the logcat log?

and when the authCode isn't correct, what's error message did you see?

Can you let us know your Reader SDK version and Android SDK version?

claudeaparecio commented 5 years ago

thanks for quick response @hukid when the authcode is incorrect the app crashes and shows an error "App has stopped"

log.txt

claudeaparecio commented 5 years ago

I am using SDKVersion 28 for android and Reader SDKVersion 1.2.0

hukid commented 5 years ago

@claude39 Thanks for the information!

From the log, it seems you have a dependency conflict in your project. Do you depend on any other modules that requires play-services-safetynet?

Please try to add this following line to your android app's build.gradle. You may choose different version based on your other dependencies: implementation ‘com.google.android.gms:play-services-safetynet:15.0.1’

claudeaparecio commented 5 years ago

I'll check on that. But, the app seems to be running perfectly when the authcode was incorrect.

I'll get back to you after trying that one.

claudeaparecio commented 5 years ago

Thanks a lot @hukid it's working now. u r awesome :D

karmatradeDev commented 1 year ago

Hi im having this problem on the newest release 1.4.3 it was working at one point.

happens at await authorizeAsync(authCode)

error: ERROR Your app just crashed. See the error below. java.lang.NoSuchMethodError: No static method createRuntimeMessageAdapter(Ljava/lang/Class;Z)Lcom/squareup/wire/internal/RuntimeMessageAdapter; in class Lcom/squareup/wire/internal/ReflectionKt; or its super classes (declaration of 'com.squareup.wire.internal.ReflectionKt' appears in /data/app/~~9krk-Kh-k6lTwc3KVoMJeQ==/com.karmatrade.app-sDA_e0C0NGPr7EFXigLjIg==/base.apk!classes31.dex) com.squareup.wire.WireTypeAdapterFactory.create(WireTypeAdapterFactory.kt:81) com.google.gson.Gson.getAdapter(Gson.java:556) retrofit2.converter.gson.GsonConverterFactory.requestBodyConverter(GsonConverterFactory.java:71) retrofit2.Retrofit.nextRequestBodyConverter(Retrofit.java:304) retrofit2.Retrofit.requestBodyConverter(Retrofit.java:284) retrofit2.RequestFactory$Builder.parseParameterAnnotation(RequestFactory.java:732) retrofit2.RequestFactory$Builder.parseParameter(RequestFactory.java:306) retrofit2.RequestFactory$Builder.build(RequestFactory.java:193) retrofit2.RequestFactory.parseAnnotations(RequestFactory.java:67) retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:26) retrofit2.Retrofit.loadServiceMethod(Retrofit.java:192) retrofit2.Retrofit$1.invoke(Retrofit.java:149) java.lang.reflect.Proxy.invoke(Proxy.java:1006) $Proxy11.login(Unknown Source) com.squareup.sdk.reader.authorization.ReaderSdkAuthenticator.login(ReaderSdkAuthenticator.kt:120) com.squareup.sdk.reader.authorization.RealAuthorizationManager.authorize(RealAuthorizationManager.java:110) com.squareup.sdk.reader.react.AuthorizationModule$2.run(AuthorizationModule.java:117) android.os.Handler.handleCallback(Handler.java:942) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loopOnce(Looper.java:201) android.os.Looper.loop(Looper.java:288) android.app.ActivityThread.main(ActivityThread.java:7884) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) › Stopped server

RN: 0.71.8 using expo 48 System: OS: macOS 13.0.1 CPU: (10) arm64 Apple M1 Pro Memory: 81.00 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node Yarn: 3.5.0 - ~/.nvm/versions/node/v16.14.0/bin/yarn npm: 8.5.4 - ~/.nvm/versions/node/v16.14.0/bin/npm Watchman: 2023.05.01.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.12.1 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 18.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: Not Found react-native: Not Found react-native-macos: Not Found npmGlobalPackages: react-native: Not Found