square / in-app-payments-flutter-plugin

Flutter Plugin for Square In-App Payments SDK
https://developer.squareup.com/docs
Apache License 2.0
340 stars 121 forks source link

Unable to start activity ComponentInfo{com.example.package/sqip.internal.CardEntryActivity} #174

Closed wade-beavers closed 2 years ago

wade-beavers commented 3 years ago

Describe the issue

When attempting to show the card entry screen on Android we are receiving this crash.

Here is the log:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ems.beerman/sqip.internal.CardEntryActivity}: java.lang.IllegalArgumentException: Cannot serialize Kotlin type sqip.internal.nonce.CreateCardNonceErrorResponse. Reflective serialization of Kotlin classes without using kotlin-reflect has undefined and unexpected behavior. Please use KotlinJsonAdapterFactory from the moshi-kotlin artifact or use code gen from the moshi-kotlin-codegen artifact.
E/AndroidRuntime(12824):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3449)
E/AndroidRuntime(12824):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
E/AndroidRuntime(12824):    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/AndroidRuntime(12824):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(12824):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(12824):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime(12824):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(12824):    at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(12824):    at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(12824):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12824):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(12824):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime(12824): Caused by: java.lang.IllegalArgumentException: Cannot serialize Kotlin type sqip.internal.nonce.CreateCardNonceErrorResponse. Reflective serialization of Kotlin classes without using kotlin-reflect has undefined and unexpected behavior. Please use KotlinJsonAdapterFactory from the moshi-kotlin artifact or use code gen from the moshi-kotlin-codegen artifact.
E/AndroidRuntime(12824):    at com.squareup.moshi.ClassJsonAdapter$1.create(ClassJsonAdapter.java:97)
E/AndroidRuntime(12824):    at com.squareup.moshi.Moshi.adapter(Moshi.java:145)
E/AndroidRuntime(12824):    at com.squareup.moshi.Moshi.adapter(Moshi.java:105)
E/AndroidRuntime(12824):    at retrofit2.converter.moshi.MoshiConverterFactory.responseBodyConverter(MoshiConverterFactory.java:91)
E/AndroidRuntime(12824):    at retrofit2.Retrofit.nextResponseBodyConverter(Retrofit.java:352)
E/AndroidRuntime(12824):    at retrofit2.Retrofit.responseBodyConverter(Retrofit.java:335)
E/AndroidRuntime(12824):    at sqip.internal.HttpModule.cardNonceErrorConverter(HttpModule.kt:61)
E/AndroidRuntime(12824):    at sqip.internal.HttpModule_CardNonceErrorConverterFactory.proxyCardNonceErrorConverter(HttpModule_CardNonceErrorConverterFactory.java:38)
E/AndroidRuntime(12824):    at sqip.internal.HttpModule_CardNonceErrorConverterFactory.provideInstance(HttpModule_CardNonceErrorConverterFactory.java:27)
E/AndroidRuntime(12824):    at sqip.internal.HttpModule_CardNonceErrorConverterFactory.get(HttpModule_CardNonceErrorConverterFactory.java:22)
E/AndroidRuntime(12824):    at sqip.internal.HttpModule_CardNonceErrorConverterFactory.get(HttpModule_CardNonceErrorConverterFactory.java:12)
E/AndroidRuntime(12824):    at sqdagger.internal.DoubleCheck.get(DoubleCheck.java:47)
E/AndroidRuntime(12824):    at sqip.internal.nonce.CreateCardNonceRequestHandler_Real_Factory.provideInstance(CreateCardNonceRequestHandler_Real_Factory.java:64)
E/AndroidRuntime(12824):    at sqip.internal.nonce.CreateCardNonceRequestHandler_Real_Factory.get(CreateCardNonceRequestHandler_Real_Factory.java:46)
E/AndroidRuntime(12824):    at sqip.internal.nonce.CreateCardNonceRequestHandler_Real_Factory.get(CreateCardNonceRequestHandler_Real_Factory.java:13)
E/AndroidRuntime(12824):    at sqdagger.internal.DoubleCheck.get(DoubleCheck.java:47)
E/AndroidRuntime(12824):    at sqip.internal.CardEntryActivityController_Factory.provideInstance(CardEntryActivityController_Factory.java:37)
E/AndroidRuntime(12824):    at sqip.internal.CardEntryActivityController_Factory.get(CardEntryActivityController_Factory.java:29)
E/AndroidRuntime(12824):    at sqip.internal.CardEntryActivityController_Factory.get(CardEntryActivityController_Factory.java:10)
E/AndroidRuntime(12824):    at sqdagger.internal.DoubleCheck.get(DoubleCheck.java:47)
E/AndroidRuntime(12824):    at sqip.internal.nonce.DaggerCardEntryActivityComponent.cardEntryActivityController(DaggerCardEntryActivityComponent.java:209)
E/AndroidRuntime(12824):    at sqip.internal.CardEntryActivity.onCreate(CardEntryActivity.kt:128)
E/AndroidRuntime(12824):    at android.app.Activity.performCreate(Activity.java:8000)
E/AndroidRuntime(12824):    at android.app.Activity.performCreate(Activity.java:7984)
E/AndroidRuntime(12824):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
E/AndroidRuntime(12824):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)

To Reproduce

Call InAppPayments.completeCardEntry()

Expected behavior

Show card entry dialog

Environment (please complete the following information):

CharmisG commented 2 years ago

Please pull latest code and let me if you are still facing this issue for now I'm closing this issue