Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28476

Getting java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 in react native

$
0
0

I am new to react-native. when I try to run my app from the android-studio with my phone connected via USB (debug mode enabled). Build succeeded& App got installed into the phone. but when I try to open the app, it crashes immediately. please check the screenshot for the error and java line from the debug mode.

enter image description here

error in debug:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.parable.rnmvp, PID: 18237
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at com.dooboolab.RNIap.RNIapModule.onPurchasesUpdated(RNIapModule.java:517)
        at com.dooboolab.RNIap.RNIapModule$11.run(RNIapModule.java:544)
        at com.dooboolab.RNIap.RNIapModule$2.onBillingSetupFinished(RNIapModule.java:103)
        at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection$1.run(BillingClientImpl.java:1521)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:232)
        at android.app.ActivityThread.main(ActivityThread.java:7165)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)

ArrayList.java (error block)

public E get(int index) {
        if (index >= size)
            throw new IndexOutOfBoundsException(outOfBoundsMsg(index)); //line 437 (from this line it throws error)
        return (E) elementData[index];
    }

Please help me to fix this issue. if I need to share any extra info. please ask in the comments.


Viewing all articles
Browse latest Browse all 28476

Trending Articles