Print not working with Android

mrctito,

Of course we care. If we didn’t care, then we would not have responded to this thread.

The truth is, we can’t reproduce this issue. And we know for a fact that the majority of our customers are able to see print statement in their Android log. So, we just need to isolate why it’s not working for you.

For example, perhaps you or a Lua library that you are using is calling io.output(), which is redirecting output away from the Android log?

Also, have you tried running a main.lua that only contains print() statements? [import]uid: 32256 topic_id: 32179 reply_id: 128530[/import]

Thank you, so much.

Sorry about my ignorance, but why the print messages work well on IOS devices, but dont on Android devices, if I am running the same App ?

Yes, I tried running an small App with just pront statements.

Thank you,
Marcos Tito. [import]uid: 62613 topic_id: 32179 reply_id: 128718[/import]

So, how are you trying to view the Android log?

I personally use the Android SDK’s “adb logcat” command line tool. The Android SDK also has a GUI tool called “ddms” which can show you the log as well. Note that your Android device must be connected to your computer via USB in order to view the log.

If you are using a Windows PC, then a reason that you might not be able to view the Android log is because you do not have your Android device’s driver installed. You’ll have to go to the manufacturer’s website and download/install it in order to connect to your device via USB. [import]uid: 32256 topic_id: 32179 reply_id: 128798[/import]

Thank you, so much.

Sorry about my ignorance, but why the print messages work well on IOS devices, but dont on Android devices, if I am running the same App ?

Yes, I tried running an small App with just pront statements.

Thank you,
Marcos Tito. [import]uid: 62613 topic_id: 32179 reply_id: 128718[/import]

So, how are you trying to view the Android log?

I personally use the Android SDK’s “adb logcat” command line tool. The Android SDK also has a GUI tool called “ddms” which can show you the log as well. Note that your Android device must be connected to your computer via USB in order to view the log.

If you are using a Windows PC, then a reason that you might not be able to view the Android log is because you do not have your Android device’s driver installed. You’ll have to go to the manufacturer’s website and download/install it in order to connect to your device via USB. [import]uid: 32256 topic_id: 32179 reply_id: 128798[/import]

I was having this problem. I use LuaGlider (former CIDER) as my IDE and I noticed that I need to click in the hammer icon (that is “Build Main Project”) before I build the app using Corona.

If I do that, the prints appears in the ddms and also in the logcat.
[import]uid: 181011 topic_id: 32179 reply_id: 137838[/import]

Oh interesting. It sounds like LuaGlider is redirecting stdout then… which I assume they redirect to a socket so that it can be viewed by its desktop app. Anyways, thanks for posting this. [import]uid: 32256 topic_id: 32179 reply_id: 137931[/import]

I was having this problem. I use LuaGlider (former CIDER) as my IDE and I noticed that I need to click in the hammer icon (that is “Build Main Project”) before I build the app using Corona.

If I do that, the prints appears in the ddms and also in the logcat.
[import]uid: 181011 topic_id: 32179 reply_id: 137838[/import]

Oh interesting. It sounds like LuaGlider is redirecting stdout then… which I assume they redirect to a socket so that it can be viewed by its desktop app. Anyways, thanks for posting this. [import]uid: 32256 topic_id: 32179 reply_id: 137931[/import]

I wanted to see if I could reopen this issue. I have an app and none of my print() calls are being logged to stdout on an Android device. They are logged in the simulator and on iOS devices. Is there any reason any one discovered why print() would not work but only on Android? Furthermore, Corona’s internal logs statements are appearing, such as 

V/Corona  ( 3467): > Class.forName: network.LuaLoader

V/Corona  ( 3467): < Class.forName: network.LuaLoader

V/Corona  ( 3467): Loading via reflection: network.LuaLoader

V/Corona  ( 3467): > Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  ( 3467): < Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  ( 3467): Loading via reflection: CoronaProvider.licensing.google.LuaLoader

This is using build 1249.

I have a second app, built with the same version of Corona. It’s print() calls are logged to stdout on Android.

I searched all over for io redirects and other suggestions I’ve read here, but I cannot find any reason. The code between my two different apps is very similar. I cannot see anything my code is doing that would interrupt print(). Does anyone have any suggestions I could try to figure out where my debug logging is going?

Well, you have the solution in your hand. Just figure out the difference between the codes of the two apps. I would focus on codes specially related to Android platform (like, I am seeing that you are using the Google Licensing in that app. Are you using it on the another?)

“Just figure out the difference between the codes of the two apps”

Yes, my first thoughts, and after many hours of doing that before I came here, I cannot find the difference. but I am not sure about this Google Lic so I will investigate what that is.

thanks.

post your build.settings here.

This is what I have, and the other project that works is almost the same (but it has iphone icons defined)

settings = { &nbsp;&nbsp;&nbsp;&nbsp;orientation = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default = "landscapeRight",&nbsp; &nbsp; &nbsp; content = "landscapeRight", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supported = { "landscapeRight" &nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp; android = { &nbsp; &nbsp; &nbsp;usesPermissions = { &nbsp; &nbsp; &nbsp; &nbsp;"android.permission.INTERNET", &nbsp; &nbsp; &nbsp; &nbsp;"android.permission.WRITE\_EXTERNAL\_STORAGE", &nbsp; &nbsp; &nbsp;}, &nbsp; }, &nbsp;&nbsp;&nbsp;&nbsp;iphone = &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plist = &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UIAppFonts =&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"CurseCasualJVE-Regular.otf", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"StintUltraCondensed-Regular.ttf", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, &nbsp; &nbsp; }, } &nbsp;

Nothing wrong there… I am afraid I cannot help much without seeing the code. If you want upload it to github and send us the link.

Thanks, I really appreciate you helping me. I am going to continue to try to figure out what the difference is between my two apps. My assumption is something unbeknownst to me is hooking into io.write and stealing my print() logs, I wish there was an easier way to identify the culprit so I can steal them back! But Corona can log stuff, so how is that? Is Corona internally using a different method that what print() uses?

I wanted to see if I could reopen this issue. I have an app and none of my print() calls are being logged to stdout on an Android device. They are logged in the simulator and on iOS devices. Is there any reason any one discovered why print() would not work but only on Android? Furthermore, Corona’s internal logs statements are appearing, such as 

V/Corona  ( 3467): > Class.forName: network.LuaLoader

V/Corona  ( 3467): < Class.forName: network.LuaLoader

V/Corona  ( 3467): Loading via reflection: network.LuaLoader

V/Corona  ( 3467): > Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  ( 3467): < Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  ( 3467): Loading via reflection: CoronaProvider.licensing.google.LuaLoader

This is using build 1249.

I have a second app, built with the same version of Corona. It’s print() calls are logged to stdout on Android.

I searched all over for io redirects and other suggestions I’ve read here, but I cannot find any reason. The code between my two different apps is very similar. I cannot see anything my code is doing that would interrupt print(). Does anyone have any suggestions I could try to figure out where my debug logging is going?

Well, you have the solution in your hand. Just figure out the difference between the codes of the two apps. I would focus on codes specially related to Android platform (like, I am seeing that you are using the Google Licensing in that app. Are you using it on the another?)

“Just figure out the difference between the codes of the two apps”

Yes, my first thoughts, and after many hours of doing that before I came here, I cannot find the difference. but I am not sure about this Google Lic so I will investigate what that is.

thanks.

post your build.settings here.