mkharibalaji / react-native-adyen-payment

React Native Adyen Payment
https://mkharibalaji.github.io/react-native-adyen-payment/
MIT License
35 stars 35 forks source link

Crash on android #23

Closed bayazetyan closed 3 years ago

bayazetyan commented 3 years ago

2020-11-27 16:14:25.809 20341-20341/com.projectId E/AndroidRuntime: FATAL EXCEPTION: main Process: com.projectId, PID: 20341 java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.Collections$SingletonList.get(Collections.java:4863) at com.rnlib.adyen.AdyenPaymentModule.createConfigurationBuilder(AdyenPaymentModule.kt:264) at com.rnlib.adyen.AdyenPaymentModule.showCardComponent(AdyenPaymentModule.kt:370) at com.rnlib.adyen.AdyenPaymentModule.access$showCardComponent(AdyenPaymentModule.kt:73) at com.rnlib.adyen.AdyenPaymentModule$showPayment$1.onResponse(AdyenPaymentModule.kt:205) at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1$1.run(DefaultCallAdapterFactory.java:83) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

--------- beginning of system
amindadgar commented 3 years ago

It seems you want to get a value from array index that is not allocated. java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 The problem here is showing that your having array with size 1 and you want to get index = 1, Here you can just access index 0 (arrays start from zero in java language!)