Android crashes NoSuchElementException

Hi all!

I made an app which is on the App Store and Google Play and I’m getting crashes on Android from Expo.
More precisely: java.util.NoSuchElementException

// package.json
    "expo": "^20.0.0",
    "react": "16.0.0-alpha.12",
    "react-native": "https://github.com/expo/react-native/archive/sdk-20.0.0.tar.gz",
    "exp": "44.0.0"

// app.json
    "sdkVersion": "20.0.0",
java.util.NoSuchElementException: 
  at java.util.LinkedList.removeFirst (LinkedList.java:270)
  at java.util.LinkedList.remove (LinkedList.java:685)
  at host.exp.exponent.experience.a.f (BaseExperienceActivity.java:180)
  at host.exp.exponent.experience.a.e (BaseExperienceActivity.java:31)
  at host.exp.exponent.experience.b.run (BaseExperienceActivity.java:141)
  at android.os.Handler.handleCallback (Handler.java:836)
  at android.os.Handler.dispatchMessage (Handler.java:103)
  at android.os.Looper.loop (Looper.java:203)
  at android.app.ActivityThread.main (ActivityThread.java:6361)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1063)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:924)

and

java.util.NoSuchElementException: 
  at java.util.LinkedList.removeFirstImpl (LinkedList.java:689)
  at java.util.LinkedList.remove (LinkedList.java:899)
  at host.exp.exponent.experience.a.f (BaseExperienceActivity.java:180)
  at host.exp.exponent.experience.a.e (BaseExperienceActivity.java:31)
  at host.exp.exponent.experience.b.run (BaseExperienceActivity.java:141)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:158)
  at android.app.ActivityThread.main (ActivityThread.java:7230)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

Those are the 2 kinds of NoSuchElementException I’m getting from my app.

Any idea of the cause and/or potential fix?

Thanks :blush:

The NoSuchElementException in Java is thrown when one tries to access an iterable beyond its maximum limit. This means that, this exception is thrown by various accessor methods to indicate that the element being requested does not exist . The next() method in Java returns the next element in the iteration or NoSuchElementException if the iteration has no more elements.

As with most programming languages, the Iterator class includes a hasNext() method that returns a boolean indicating if the iteration has anymore elements. If hasNext() returns true, then the next() method will return the next element in the iteration otherwise raise exceptions if the iteration has no more elements.

if(input.hasNextInt() )
     number1 = input.nextInt(); // if there is another number  
else 
     number1 = 0; // nothing added in the input