print function missing output to android logcat using corona physics based game template

Hi,

I’ve seen some other threads about how the print statement does not output to android logcat using a corona app built for android. I’ve been doing some investigating because the app I built does not output print statements when deployed to an android device.

I did some testing using the built in Corona template named “Physics Based Game”. (Find attached project code)

  1. I created a brand new app using the “Physics Based Game” template from the Corona Simulator New Project wizard.

  2. I added strategic print statements to the start and end of each lua file as well as to the start and end of the createScene and enterScene methods in each of the lua files (where applicable).

  3. I ran the app in the Corona simulator and recorded the output

  4. I built the app for android and deployed it to an android device emulator and recorded the logcat output

Below are my results…

Corona simulator console output:

Copyright © 2009-2013  C o r o n a   L a b s   I n c .

        Version: 3.0.0

        Build: 2013.2100

main.lua - executing

menu.lua - executing

menu.lua - executed

menu.lua - createScene start

Warning: could not load font HelveticaNeue-Light. Using default font.

menu.lua - createScene end

main.lua - executed

menu.lua - enterScene start

menu.lua - enterScene end

level1.lua - executing

level1.lua - executed

level1.lua - createScene start

level1.lua - createScene end

level1.lua - enterScene start

level1.lua - enterScene end

Android device emulator logcat output:

02-24 18:36:10.012: I/ActivityManager(385): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.outlook.spacewolf.hello_world2/com.ansca.corona.CoronaActivity} from pid 752

02-24 18:36:10.252: I/ActivityManager(385): Start proc com.outlook.spacewolf.hello_world2 for activity com.outlook.spacewolf.hello_world2/com.ansca.corona.CoronaActivity: pid=2307 uid=10060 gids={50060}

02-24 18:36:13.272: I/Corona(2307): menu.lua - createScene start

02-24 18:36:13.352: I/Corona(2307): menu.lua - enterScene start

02-24 18:36:28.762: I/Corona(2307): level1.lua - createScene start

02-24 18:36:29.822: I/Corona(2307): level1.lua - enterScene start

Conclusion

As you can see, there are many print statements missing from the logcat output. I did not filter the logcat output in any way.

Corona guys, can you please comment on this? It looks like there is a bug… 

My system

Corona Simulator 2013.2100

Android Emulator Device:

  - Target: Android 4.4.2

  - API Level: 19

  - CPU/ABI - ARM (armeabi-v7a)

Java 6

Update:

I tried deploying the same app to an earlier version of android (4.0.4) and got the following logcat output:

02-26 00:31:42.481: I/ActivityManager(93): Displayed com.outlook.spacewolf.hello_world2/com.ansca.corona.CoronaActivity: +2s572ms

02-26 00:31:42.681: V/Corona(597): > Class.forName: network.LuaLoader

02-26 00:31:42.681: V/Corona(597): < Class.forName: network.LuaLoader

02-26 00:31:42.681: V/Corona(597): Loading via reflection: network.LuaLoader

02-26 00:31:42.811: V/Corona(597): > Class.forName: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.811: V/Corona(597): < Class.forName: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.831: V/Corona(597): Loading via reflection: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.871: I/Corona(597): main.lua - executing

02-26 00:31:42.891: I/Corona(597): menu.lua - executing

02-26 00:31:42.901: I/Corona(597): menu.lua - executed

02-26 00:31:42.901: I/Corona(597): menu.lua - createScene start

02-26 00:31:42.971: I/Corona(597): menu.lua - createScene end

02-26 00:31:42.971: I/Corona(597): main.lua - executed

02-26 00:31:42.981: I/Corona(597): menu.lua - enterScene start

02-26 00:31:42.981: I/Corona(597): menu.lua - enterScene end

02-26 00:31:43.051: D/dalvikvm(597): GC_FOR_ALLOC freed 372K, 6% free 9306K/9799K, paused 47ms

02-26 00:31:43.061: I/dalvikvm-heap(597): Grow heap (frag case) to 9.741MB for 614416-byte allocation

02-26 00:31:43.131: D/dalvikvm(597): GC_FOR_ALLOC freed <1K, 6% free 9906K/10439K, paused 39ms

02-26 00:31:43.251: D/dalvikvm(597): GC_CONCURRENT freed 21K, 6% free 9885K/10439K, paused 5ms+3ms

02-26 00:31:43.261: W/NetworkManagementSocketTagger(93): setKernelCountSet(10013, 0) failed with errno -2

02-26 00:31:45.581: I/Corona(597): level1.lua - executing

02-26 00:31:45.591: I/Corona(597): level1.lua - executed

02-26 00:31:45.591: I/Corona(597): level1.lua - createScene start

02-26 00:31:45.601: I/Corona(597): level1.lua - createScene end

02-26 00:31:46.725: I/Corona(597): level1.lua - enterScene start

02-26 00:31:46.725: I/Corona(597): level1.lua - enterScene end


This matches the output from the Corona Simulator. So it looks like there is a corona regression bug when the app is deployed to a device running a more recent version of android. Corona folks, can you comment please?

Update:

I tried deploying the same app to an earlier version of android (4.0.4) and got the following logcat output:

02-26 00:31:42.481: I/ActivityManager(93): Displayed com.outlook.spacewolf.hello_world2/com.ansca.corona.CoronaActivity: +2s572ms

02-26 00:31:42.681: V/Corona(597): > Class.forName: network.LuaLoader

02-26 00:31:42.681: V/Corona(597): < Class.forName: network.LuaLoader

02-26 00:31:42.681: V/Corona(597): Loading via reflection: network.LuaLoader

02-26 00:31:42.811: V/Corona(597): > Class.forName: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.811: V/Corona(597): < Class.forName: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.831: V/Corona(597): Loading via reflection: CoronaProvider.licensing.google.LuaLoader

02-26 00:31:42.871: I/Corona(597): main.lua - executing

02-26 00:31:42.891: I/Corona(597): menu.lua - executing

02-26 00:31:42.901: I/Corona(597): menu.lua - executed

02-26 00:31:42.901: I/Corona(597): menu.lua - createScene start

02-26 00:31:42.971: I/Corona(597): menu.lua - createScene end

02-26 00:31:42.971: I/Corona(597): main.lua - executed

02-26 00:31:42.981: I/Corona(597): menu.lua - enterScene start

02-26 00:31:42.981: I/Corona(597): menu.lua - enterScene end

02-26 00:31:43.051: D/dalvikvm(597): GC_FOR_ALLOC freed 372K, 6% free 9306K/9799K, paused 47ms

02-26 00:31:43.061: I/dalvikvm-heap(597): Grow heap (frag case) to 9.741MB for 614416-byte allocation

02-26 00:31:43.131: D/dalvikvm(597): GC_FOR_ALLOC freed <1K, 6% free 9906K/10439K, paused 39ms

02-26 00:31:43.251: D/dalvikvm(597): GC_CONCURRENT freed 21K, 6% free 9885K/10439K, paused 5ms+3ms

02-26 00:31:43.261: W/NetworkManagementSocketTagger(93): setKernelCountSet(10013, 0) failed with errno -2

02-26 00:31:45.581: I/Corona(597): level1.lua - executing

02-26 00:31:45.591: I/Corona(597): level1.lua - executed

02-26 00:31:45.591: I/Corona(597): level1.lua - createScene start

02-26 00:31:45.601: I/Corona(597): level1.lua - createScene end

02-26 00:31:46.725: I/Corona(597): level1.lua - enterScene start

02-26 00:31:46.725: I/Corona(597): level1.lua - enterScene end


This matches the output from the Corona Simulator. So it looks like there is a corona regression bug when the app is deployed to a device running a more recent version of android. Corona folks, can you comment please?