I am getting the following error
java.util.NoSuchElementException
When I click on it to reveal more information, this is what it says.
Caused by: java.util.NoSuchElementException
Unlike previous errors, it doesn't show where the error is coming from. How do I fix this issue? I am looking through all my files and nothing seems to be giving me an error. Any tips or suggestions are appreciated.
Solution. The solution to this exception is to check whether the next position of an iterable is filled or empty. You should only move to this position if the check returns that the position is not empty.
Cause for NosuchElementException If you call the nextElement() method of the Enumeration class on an empty enumeration object or, if the current position is at the end of the Enumeration, a NosuchElementException is generated at run time.
The NoSuchElementException is thrown by Scanner class, Iterator interface, Enumerator interface, and StringTokenizer class. These classes have accessors' methods to fetch the next element from an iterable. They throw NoSuchElementException if the iterable is empty or has reached the maximum limit.
@Izabela is right. However, in my case, I navigated to File -> Settings -> Build,Execution,Deployment -> Instant Run and disabled it by simply unchecking the topmost checkbox (which was enabled by default). Its working perfectly for me (till now). I am running Android Studio 3.0.1 on Ubuntu 16.04 LTS.
try adding this to your gradle.properties file
android.enableAapt2=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With