SOLVED system.openUrl crashes app and causes cold app boot upon resume

On Monday I released version 1.0 of my app, ICE:  Internet Concept Explorer.  It was accepted by Apple right out of the gate with no rejections… thank you Corona! 

I used build 1235 to produce that version.  I am working on version 1.1 of my app, but now, when the user presses a button which does this:

system.openURL( url )

I get this in the XCode device console:

Nov 13 08:49:49  kernel[0] <Debug>: launchd[17150] Container:/private/var/mobile/Applications/264EA2C6-618D-4A02-9238-82667787C709(sandbox)

Nov 13 08:49:51 accountsd[17151] <Error>: assertion failed:11B511: liblaunch.dylib + 19411 [7A8632AC-3E19-37EC-AFF1-672D2AD2A359]:0x25

Nov 13 08:49:51  Unknown[17151] <Error>: 

Nov 13 08:49:52  backboardd[29] <Warning>: CoreAnimation: updates deferred for too long

Nov 13 08:49:52  backboardd[29] <Warning>: CoreAnimation: timed out fence 59d13

At this point, I believe the app is crashed, and so when the user heads back to the app it restarts the app cold, which is very undesirable, since more than likely they will want to press a button to bring up another URL, and not have to sweat to get back to where they left off.

This behavior is new in the last 16 days, as version 1.0 was submitted to Apple on October 29 and did not have this problem.

I tried using build 1257, as I thought it might be related to the Facebook login problem some folks were having, but it did not fix the issue.

Ideas?

 

More information about this issue:

  • The code works on both the Windows and Mac simulators, but not on an iPad.
     
  • If I comment out that single line (system.URL( url )), the app will NOT crash on the iPad 2.  It is running iOS 7.
     
  • This bug appeared after October 29, and exists even if I build under 1235 or 1257.  So I am guessing it has something to do with a change in the build process after October 29.
     
  • I’ve moved the offending line of code around to various places in my app, including amongst the first executable lua lines, and it always crashes the app.

Does your iPad crash no matter what url you use?  Or have all of your tests so far been using the same url?

  • Andrew

Thanks for responding, Andrew.  The url does not matter… crashes no matter what.

Have you tried not just moving it around your app, but creating a new, simple test app where system.openURL() is literally the only line of code (or triggered by a simple button), with a url hardcoded into the function?  That way, we can rule out any other code-related factors.

For the URLs you tested, when you pass them to the function, are you including http:// in front or not?

Do you have any other iOS devices you can test on besides your iPad 2 (just in case it’s device or device type specific, though I doubt it)?

  • Andrew

Andrew, I am going to buy a FIRE HD today anyway… I want to publish ‘ICE: Internet Concept Explorer’ into the Amazon store anyway, and I want to see if the FIRE has the same problem.  I am thinking it won’t exhibit this bug.

I will let you know soonest.  If it doesn’t work in the FIRE, I will make a one line app and see how that works.

Hi Andrew.

I got a new FIRE HD, 7 inch, and tried sideloading my app.  It starts up OK, but none of logging messages appear in the device logs.  Seems like the last time I did this, 6 months ago, I could see Corona prints to the device log.  ?

So I never get far enough to test the problem above.  :frowning:

I DO see an error ‘can not read UMENG_CHANNEL meta-data from AndroidManifest.xml’, which leads me to think the build is not correct.  Later I get the ‘forget to include ACCESS_WIFI_STATE permission?’… but I definitely set that in my build.settings.  So again it sounds like the build did not make the manifest properly.

More information about this problem.  I built a single line app:
 

system.openURL( "http://www.google.com" )

This line of code crashes the app on the iPad device, but not in the Windows or Mac simulators.  On the device, if I try to return to the app, it has crashed.

 

Nov 14 16:34:56 SpringBoard[33] <Warning>: LICreateIconForImage passed NULL CGImageRef image

 

quite a delay here… maybe 5 seconds before Google pops up, then these error messages:

 

Nov 14 16:34:56  kernel[0] <Debug>: launchd[18984] Container:/private/var/mobile/Applications/5679A22B-E042-48FE-A506-5B9A121028B1(sandbox)

Nov 14 16:35:07  backboardd[29] <Warning>: CoreAnimation: timed out fence 63cdb

 

then try to return to app:

 

Nov 14 16:35:07  lsd[18490] <Warning>: LaunchServices: application launch failed - received error code 11

Nov 14 16:35:08  TestopenURL[18984] <Warning>: CoreAnimation: failed to receive fence reply: 10004003

 

 

 

Quite strange.  I’d suggest you file a bug report for this with your simple TestopenURL application.

Also, what build.settings did you use for the test application (if any)?

  • Andrew

Thanks, Andrew.  Here are my build settings for both ICE and the stripped down project:

 

iphone = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plist = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CFBundleShortVersionString = "1.1", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CFBundleIconFile = "Icon.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CFBundleIconFiles = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small-40.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small-40@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-60.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-60@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-72.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-72@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-76.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-76@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small-50.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small-50@2x.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small.png", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Icon-Small@2x.png" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UIPrerenderedIcon = true, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UIFileSharingEnabled = false, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UIStatusBarHidden = true, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UIApplicationExitsOnSuspend = true, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; }, android = &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usesPermissions = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.INTERNET", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.ACCESS\_WIFI\_STATE", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.ACCESS\_NETWORK\_STATE", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.WRITE\_EXTERNAL\_STORAGE", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.RECEIVE\_BOOT\_COMPLETED", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "com.android.vending.BILLING", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "android.permission.GET\_ACCOUNTS", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; &nbsp;

I think your issue is being caused by the line “UIApplicationExitsOnSuspend = true”.  That means that, when the user moves out of your app for any reason (such as pressing the home button or, in your case, visiting a URL), the app will completely forcibly close instead of suspending.

Just remove that line, and you should be fine.

  • Andrew

I tried that along the way… was the first thing I played with a few days ago.  Did not help at that time, but I will try it with the stripped down app.

Andrew,

Thanks for your help!  I submitted a bug report… changing the “UIApplicationExitsOnSuspend” flag makes no difference.

David

Andrew,

BTW, when I tried to run my app on a new FIRE HD 7", it appeared to run (the gui came up and I could enter search terms, etc), but absolutely no console messages appear on the device logs.  I am using an app called ‘aLogcat’, which allows one to filter console messages.  aLogcat shows various other android messages, but not a single Corona message.

So then I downloaded the adb tools, and tried to connect the FIRE to my PC via the USB port, but ‘adb devices’ only shows the emulator, not the FIRE.   If I try:

adb logcat Corona:v \*:s

I get this:

E/PGA  <520>:  PgaSocketWriteAllHdipc: hd_ipc_send() failed

W/PGA <520>: ctlSwapBuffers(133): Host Connect failed, err = -1

My PC can ‘see’ the FIRE via file explorer, so it appears to be connected through the USB ok.  I have the ‘developer’ and ‘unknown source’ modes set to on.  Without the ability to see what is in the device console, either through ‘aLogcat’ or ‘adb’, I am stuck in the water.  Is Corona is keeping up with all these stores/devices/IDEs, etc?

BTW, I am trying to connect to the FIRE on a Win 7 platform, with Java 1.7.0_45.

David

The problem could not be replicated by Corona staff, so they recommended a power reset.  That fixed the problem on one of the two devices that showed the bug.  The other device is not available for a test.  Clearing out all applications from the device execution stack did not solve the problem, but a full power reset did.

More information about this issue:

  • The code works on both the Windows and Mac simulators, but not on an iPad.
     
  • If I comment out that single line (system.URL( url )), the app will NOT crash on the iPad 2.  It is running iOS 7.
     
  • This bug appeared after October 29, and exists even if I build under 1235 or 1257.  So I am guessing it has something to do with a change in the build process after October 29.
     
  • I’ve moved the offending line of code around to various places in my app, including amongst the first executable lua lines, and it always crashes the app.

Does your iPad crash no matter what url you use?  Or have all of your tests so far been using the same url?

  • Andrew

Thanks for responding, Andrew.  The url does not matter… crashes no matter what.

Have you tried not just moving it around your app, but creating a new, simple test app where system.openURL() is literally the only line of code (or triggered by a simple button), with a url hardcoded into the function?  That way, we can rule out any other code-related factors.

For the URLs you tested, when you pass them to the function, are you including http:// in front or not?

Do you have any other iOS devices you can test on besides your iPad 2 (just in case it’s device or device type specific, though I doubt it)?

  • Andrew

Andrew, I am going to buy a FIRE HD today anyway… I want to publish ‘ICE: Internet Concept Explorer’ into the Amazon store anyway, and I want to see if the FIRE has the same problem.  I am thinking it won’t exhibit this bug.

I will let you know soonest.  If it doesn’t work in the FIRE, I will make a one line app and see how that works.