PhilipsHue / PhilipsHueSDK-Java-MultiPlatform-Android

The Software Development Kit for Philips Hue Java Mulfi-Platform and Android (beta)
273 stars 214 forks source link

ConcurrentModificationException #39

Open danzada1 opened 6 years ago

danzada1 commented 6 years ago

Hi guys, I keep getting the below exception. I suspect it has to do with starting and stopping the bridge heartbeat too quickly due to android's lifecycle but I haven't been able to root cause it. Anybody have any ideas? Thanks!

Exception java.util.ConcurrentModificationException: java.util.ArrayList$ArrayListIterator.next (ArrayList.java:573) com.philips.lighting.hue.sdk.notification.impl.PHNotificationManagerImpl$8.onReceived (PHNotificationManagerImpl.java:296) com.philips.lighting.hue.sdk.notification.impl.PHHueResultReceiver.execute (PHHueResultReceiver.java:24) com.philips.lighting.hue.sdk.notification.impl.PHNotificationManagerImpl.notifyConnectionResumed (PHNotificationManagerImpl.java:303) com.philips.lighting.hue.sdk.heartbeat.PHHeartbeatProcessor.run (PHHeartbeatProcessor.java:148) java.util.Timer$TimerImpl.run (Timer.java:284)

SteveyO commented 6 years ago

Yeah, I vaguely remember seeing this one before. It sounds like you may have duplicated something, i.e. maybe registered the PHSDKListener in 2 different places (or Android Activities), or have 2 instances of the heartbeat running. I would suggest checking your code for all places you create any listeners/instances for duplicates. Sorry not more specific, been a long time since worked on the SDK.