Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.NoSuchElementException after app is running for 2-4 days #139

Open
bromeostasis opened this issue Apr 15, 2016 · 3 comments
Open

Comments

@bromeostasis
Copy link

After we leave our app in the background for a few days with this plugin running, it crashes in the background with no explanation. After writing a custom java exception handler, I finally was able to grab the following stacktrace:

Date: Fri Apr 15 07:57:44 EDT 2016
java.util.NoSuchElementException
    at java.util.LinkedList.removeFirstImpl(LinkedList.java:689)
    at java.util.LinkedList.removeFirst(LinkedList.java:676)
    at java.util.LinkedList.poll(LinkedList.java:895)
    at com.cowbell.cordova.geofence.GoogleServiceCommandExecutor.ExecuteNext(GoogleServiceCommandExecutor.java:26)
    at com.cowbell.cordova.geofence.GoogleServiceCommandExecutor.onCommandExecuted(GoogleServiceCommandExecutor.java:35)
    at com.cowbell.cordova.geofence.AbstractGoogleServiceCommand.CommandExecuted(AbstractGoogleServiceCommand.java:101)
    at com.cowbell.cordova.geofence.AddGeofenceCommand$1.onResult(AddGeofenceCommand.java:73)
    at com.cowbell.cordova.geofence.AddGeofenceCommand$1.onResult(AddGeofenceCommand.java:55)
    at com.google.android.gms.common.api.internal.zzb$zza.zzb(Unknown Source)
    at com.google.android.gms.common.api.internal.zzb$zza.handleMessage(Unknown Source)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5290)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

The issue seems to mostly happen while moving around in the car (presumably entering/exiting a lot of geofences). As mentioned, it takes a long time to reproduce, so we don't have a ton of info on root causes.

I haven't had much time to look at this/analyze today, but I was wondering if anyone else has seen this issue or could provide some insight into why this might happen. I'm happy to provide any more details about cause/testing/etc.

Thanks in advance!

@bromeostasis
Copy link
Author

Got another different error with a build in the background for a few days:

java.lang.RuntimeException: Init failed
    at android.media.ToneGenerator.native_setup(Native Method)
    at android.media.ToneGenerator.<init>(ToneGenerator.java:771)
    at com.cowbell.cordova.geofence.BeepHelper.<init>(BeepHelper.java:10)
    at com.cowbell.cordova.geofence.GeoNotificationNotifier.<init>(GeoNotificationNotifier.java:24)
    at com.cowbell.cordova.geofence.ReceiveTransitionsIntentService.onHandleIntent(ReceiveTransitionsIntentService.java:45)
    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.os.HandlerThread.run(HandlerThread.java:61)

which I've linked to #73

@jyyblue1987
Copy link

I have same error as first stack trace.

@bromeostasis
Copy link
Author

@jyyblue1987 we've since moved to https://github.com/transistorsoft/cordova-background-geolocation , which does not have as many problems in the background, but we do pay for Android use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants