Bug: RuntimeException when application is suspended

Saw the following stacktrace in the Play console today. I caused this myself by turning off the phone mid-game, and then turning it back on a few minutes later. When I turned the phone back on, the game was frozen. I got back to the android home screen via the home button, and when I tried to relaunch the game it immediately threw up a “<game> is not responding. Report?” dialog. 

Simulator version: 2016.2906 (2016.6.21)

Device: Galaxy SIII (SCH-I535)

OS: Android 4.4.2

java.lang.RuntimeException: Unable to pause activity {com.applefork.bp/com.ansca.corona.CoronaActivity}: java.util.ConcurrentModificationException

at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3277)

at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3232)

at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3210)

at android.app.ActivityThread.access$1100(ActivityThread.java:169)

at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1291)

at android.os.Handler.dispatchMessage(Handler.java:102)

at android.os.Looper.loop(Looper.java:146)

at android.app.ActivityThread.main(ActivityThread.java:5487)

at java.lang.reflect.Method.invokeNative(Native Method)

at java.lang.reflect.Method.invoke(Method.java:515)

at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)

at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)

at dalvik.system.NativeStart.main(Native Method)

Caused by: java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(HashMap.java:806)

at java.util.HashMap$KeyIterator.next(HashMap.java:833)

at com.ansca.corona.MediaManager.pauseAll(MediaManager.java:279)

at com.ansca.corona.Controller.stop(Controller.java:271)

at com.ansca.corona.CoronaActivity.requestSuspendCoronaRuntime(CoronaActivity.java:1763)

at com.ansca.corona.CoronaActivity.onPause(CoronaActivity.java:1601)

at android.app.Activity.performPause(Activity.java:5555)

at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1239)

at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3263)

… 12 more

What version of Corona SDK are you using that caused this?

Can you reproduce this using the latest daily build?
 

Can you post your build.settings file please?

Thanks

Rob

Is this game live for other users or are you the lone tester at the moment? We want to make sure this is coming from your device and not someone else’s device.

Thanks

rob

Hey Rob sorry for the late reply. For some reason I didn’t see the email notification about your response. 

This was built via: 2016.2906 (2016.6.21) – I don’t want to swap out the SDK until I’ve had a chance to test it more thoroughly. 

I was the lone tester at the time, and I saw the crash appear in the console pretty much in real time, so I’m confident it was my device. 

build.settings below. Thanks! [Edit: Ugh, sorry it didn’t preserve the formatting after I hit “Post.” Hopefully your text edit can autoformat it.]

settings = {       orientation = {   default = “landscapeRight”,   supported = { “landscapeRight”, “landscapeLeft”}   },       build = {   neverStripDebugInfo = true   },       iphone = {   plist = {   UIStatusBarHidden = true,   UIPrerenderedIcon = false,   UIApplicationExitsOnSuspend = false,       – Facebook   FacebookAppID = “xxxxxxx”,   CFBundleURLTypes =   {   { CFBundleURLSchemes = { “xxxxxxx”, } }   },       – Whitelist Facebook Servers for Network Requests   NSAppTransportSecurity =   {   NSExceptionDomains =   {   [“fbcdn.net”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   [“facebook.com”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   [“akamaihd.net”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   },   },       – Whitelist Facebook Apps   LSApplicationQueriesSchemes =   {   “fb”,   “fbapi20130214”,   “fbapi20130410”,   “fbapi20140410”,   “fbapi20140116”,   “fbapi20150313”,   “fbapi20150629”,   “fbauth”,   “fbauth2”,   “fb-messenger-api20140430”,   },   }   },       android =   {   googlePlayGamesAppId = “xxxxxxx”,   facebookAppId = “xxxxxxx”,   usesPermissions =   {   “android.permission.INTERNET”,   “com.android.vending.BILLING”,   “com.android.vending.CHECK_LICENSE”,   “android.permission.WRITE_EXTERNAL_STORAGE”,   “android.permission.ACCESS_NETWORK_STATE”,   },   usesFeatures =   {   {name=“android.hardware.screen.landscape”, required=true},   },   },       plugins =   {   [“plugin.advertisingId”] =   {   publisherId = “com.coronalabs”   },   [“plugin.flurry.analytics”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { iphone=true, android=true }   },   [“CoronaProvider.gameNetwork.google”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android = true }   },   [“plugin.google.iap.v3”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android=true }   },   [“plugin.GameThrivePushNotifications”] =   {   publisherId = “com.gamethrive”,   },   [“plugin.google.play.services”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android=true, [“android-kindle”]=true },   },   [“plugin.facebook.v4”] =   {   publisherId = “com.coronalabs”   },   [“CoronaProvider.ads.vungle”] =   {   publisherId = “com.vungle”,   },   [“plugin.hockey”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { iphone=true, android=true }   },   }   }

Can you repost using code formatting?

What version of Corona SDK are you using that caused this?

Can you reproduce this using the latest daily build?
 

Can you post your build.settings file please?

Thanks

Rob

Is this game live for other users or are you the lone tester at the moment? We want to make sure this is coming from your device and not someone else’s device.

Thanks

rob

Hey Rob sorry for the late reply. For some reason I didn’t see the email notification about your response. 

This was built via: 2016.2906 (2016.6.21) – I don’t want to swap out the SDK until I’ve had a chance to test it more thoroughly. 

I was the lone tester at the time, and I saw the crash appear in the console pretty much in real time, so I’m confident it was my device. 

build.settings below. Thanks! [Edit: Ugh, sorry it didn’t preserve the formatting after I hit “Post.” Hopefully your text edit can autoformat it.]

settings = {       orientation = {   default = “landscapeRight”,   supported = { “landscapeRight”, “landscapeLeft”}   },       build = {   neverStripDebugInfo = true   },       iphone = {   plist = {   UIStatusBarHidden = true,   UIPrerenderedIcon = false,   UIApplicationExitsOnSuspend = false,       – Facebook   FacebookAppID = “xxxxxxx”,   CFBundleURLTypes =   {   { CFBundleURLSchemes = { “xxxxxxx”, } }   },       – Whitelist Facebook Servers for Network Requests   NSAppTransportSecurity =   {   NSExceptionDomains =   {   [“fbcdn.net”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   [“facebook.com”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   [“akamaihd.net”] =   {   NSIncludesSubdomains = true,   NSExceptionRequiresForwardSecrecy = false,   },   },   },       – Whitelist Facebook Apps   LSApplicationQueriesSchemes =   {   “fb”,   “fbapi20130214”,   “fbapi20130410”,   “fbapi20140410”,   “fbapi20140116”,   “fbapi20150313”,   “fbapi20150629”,   “fbauth”,   “fbauth2”,   “fb-messenger-api20140430”,   },   }   },       android =   {   googlePlayGamesAppId = “xxxxxxx”,   facebookAppId = “xxxxxxx”,   usesPermissions =   {   “android.permission.INTERNET”,   “com.android.vending.BILLING”,   “com.android.vending.CHECK_LICENSE”,   “android.permission.WRITE_EXTERNAL_STORAGE”,   “android.permission.ACCESS_NETWORK_STATE”,   },   usesFeatures =   {   {name=“android.hardware.screen.landscape”, required=true},   },   },       plugins =   {   [“plugin.advertisingId”] =   {   publisherId = “com.coronalabs”   },   [“plugin.flurry.analytics”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { iphone=true, android=true }   },   [“CoronaProvider.gameNetwork.google”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android = true }   },   [“plugin.google.iap.v3”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android=true }   },   [“plugin.GameThrivePushNotifications”] =   {   publisherId = “com.gamethrive”,   },   [“plugin.google.play.services”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { android=true, [“android-kindle”]=true },   },   [“plugin.facebook.v4”] =   {   publisherId = “com.coronalabs”   },   [“CoronaProvider.ads.vungle”] =   {   publisherId = “com.vungle”,   },   [“plugin.hockey”] =   {   publisherId = “com.coronalabs”,   supportedPlatforms = { iphone=true, android=true }   },   }   }

Can you repost using code formatting?