JcPlayer
JcPlayer copied to clipboard
java.lang.StackOverflowError: stack size 8MB
Getting stackoverflow error some times, not sure about the scenario when it is occuring
java.lang.StackOverflowError: stack size 8MB
at com.example.jean.jcplayer.service.notification.JcNotificationPlayer$Companion.getInstance(Unknown Source:2)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:186)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
at com.example.jean.jcplayer.JcPlayerManager.createNewNotification(JcPlayerManager.kt:192)
hey bro, Did you solve this error..??
@MustafaAndroid I added a try catch
try {
createNewNotification(iconResource)
} catch (e: Exception) {
e.printStackTrace()
}
Same here, the problem occurs when you call createNewNotification, close app without removing it from the recents list, then launch and call createNewNotification again.
Only hack I've found so far is to keep a boolean in a static class to check whether you should call createNewNotification again or not.
@melihakalan Not necessarily needed, if you use same notification ID, the old notification will be automatically removed.