Black screen on device.

Well I solved my black screen issue. I’m not sure if you have a similar situation, but in my case it was a physics.setGravity() issue.

Why this works on pre-Android 3 is a mystery. Anyway…

Will cause crash (BlackSOD) on Android 3-4, works fine in Android 2.3.3 and emulator:

[lua]local physics = require( “physics” )
physics.setGravity( 0, 11 )
physics.start()[/lua]

Will work on everything (it seems):
[lua]local physics = require( “physics” )
physics.start()
physics.setGravity( 0, 11 ) – start physics, then set gravity[/lua]

Hope that helps someone. [import]uid: 202223 topic_id: 35166 reply_id: 139957[/import]

So here is the adb dump, if anyone can see the issue:

Removed, see next post… [import]uid: 202223 topic_id: 35166 reply_id: 139951[/import]

@develephant
Good to know… [import]uid: 70847 topic_id: 35166 reply_id: 139959[/import]

Additional info:

In my build window, In application name I have a name that is 19 characters and have upper case and lower case characters in it.

My package name is like this: com.deadsomethingthing.mylonggamenamehere

so just in case.

I’m not doing anything strange in my game like showing ads or anything, just simple drag and drop objects around and I use os.time() in several places. [import]uid: 206803 topic_id: 35166 reply_id: 139788[/import]

Android isn’t my forte, but I’m guessing the first thing anyone here will ask you is to setup something to get console messages from your device, maybe as described here. In my (admittedly iOS side) experience, when you get a black screen on device and not on simulator, you’ve made a very specific error that - while not a big deal to solve - could take you a long time to find without simply reading the error message.

(For example, the most common error is improperly calling an asset. I believe the SDK isn’t entirely case specific while devices are.) [import]uid: 41884 topic_id: 35166 reply_id: 139801[/import]

Make sure there are no errors in your build.settings file.
[import]uid: 199310 topic_id: 35166 reply_id: 139812[/import]

Thanks richard, I’m working on make ADB work.

@Rob, I can’t see any problems with my build.settings file, would you please take a look?

-- Supported values for orientation:  
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight  
  
settings = {  
  
 orientation = {  
 default = "landscapeRight",  
 supported =  
 {  
 "landscapeLeft", "landscapeRight"  
 }  
 },  
  
 iphone = {  
 plist = {  
 UIStatusBarHidden = false,  
 UIPrerenderedIcon = true, -- set to false for "shine" overlay  
 --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend  
  
 --[[  
 -- iOS app URL schemes:  
 CFBundleURLTypes =  
 {  
 {  
 CFBundleURLSchemes =  
 {  
 "fbXXXXXXXXXXXXXX", -- example scheme for facebook  
 "coronasdkapp", -- example second scheme  
 }  
 }  
 }  
 --]]  
 }  
 },  
  
 --[[  
 -- Android permissions  
  
 androidPermissions = {  
 "android.permission.INTERNET",  
 },  
  
 ]]--  
}  
  

I’m also using Glider as IDE, are there any reported problems with it? [import]uid: 206803 topic_id: 35166 reply_id: 139874[/import]

There is some errors in your setting file. kindly rectify them also. [import]uid: 216620 topic_id: 35166 reply_id: 139882[/import]

Thanks. Would you please indicate the error? [import]uid: 206803 topic_id: 35166 reply_id: 139889[/import]

As I’m super frustrated over this, I removed all iOS settings and reduced it to this:

settings =  
{  
 orientation =  
 {  
 default = "landscapeRight",  
 supported =  
 {  
 "landscapeLeft", "landscapeRight",  
 },  
 },  
}  
  

That’s got to be right, right?

Anything else? [import]uid: 206803 topic_id: 35166 reply_id: 139894[/import]

This seems like the time to look at the logcat.

While having your device connected via USB you can do an ‘adb logcat’ from the command line before starting your app (assuming you have the Android SDK installed).
You’ll be able to see if any errors are reported while running your app… [import]uid: 70847 topic_id: 35166 reply_id: 139896[/import]

As I don’t have access to a device, I installed my apk itno AVD (android SDK emulator) and got this:

E/AndroidRuntime( 525): at com.ansca.corona.JavaToNativeShim.<clinit>(JavaToNativeShim.java:93)<br>E/AndroidRuntime( 525): ... 14 more<br>W/ActivityManager( 69): Force finishing activity com.dnsgames.games.shm/com.ansca.corona.CoronaActivity<br>W/ActivityManager( 69): Activity pause timeout for HistoryRecord{4075eaf0 com.dnsgames.games.shm/com.ansca.corona.CoronaActivity}<br>D/dalvikvm( 69): GC_EXPLICIT freed 160K, 59% free 4347K/10375K, external 5835K/6312K, paused 251ms<br>I/WindowManager( 69): Setting rotation to 0, animFlags=1<br>I/ActivityManager( 69): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=25}<br>I/Process ( 525): Sending signal. PID: 525 SIG: 9<br>I/ActivityManager( 69): Process com.dnsgames.games.shm (pid 525) has died.<br>W/InputManagerService( 69): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@408a5998<br>D/dalvikvm( 69): GC_EXPLICIT freed 38K, 59% free 4326K/10375K, external 4669K/5830K, paused 114ms<br>W/ActivityManager( 69): Activity destroy timeout for HistoryRecord{4075eaf0 com.dnsgames.games.shm/com.ansca.corona.CoronaActivity}<br>I/ActivityManager( 69): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.dnsgames.gam<br>es.shm/com.ansca.corona.CoronaActivity } from pid 227<br>I/ActivityManager( 69): Start proc com.dnsgames.games.shm for activity com.dnsgames.games.shm/com.ansca.corona.CoronaActivity: pid=538 uid=10034 gid<br>s={3003}<br>I/WindowManager( 69): Setting rotation to 1, animFlags=1<br>I/ActivityManager( 69): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=1/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=26}<br>I/ActivityThread( 538): Pub com.dnsgames.games.shm.files: com.ansca.corona.FileContentProvider<br>W/dalvikvm( 538): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/JavaToNativeShim;<br>D/AndroidRuntime( 538): Shutting down VM<br>W/dalvikvm( 538): threadid=1: thread exiting with uncaught exception (group=0x40015560)<br>E/AndroidRuntime( 538): FATAL EXCEPTION: main<br>E/AndroidRuntime( 538): java.lang.ExceptionInInitializerError<br>E/AndroidRuntime( 538): at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:166)<br>E/AndroidRuntime( 538): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)<br>E/AndroidRuntime( 538): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)<br>E/AndroidRuntime( 538): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)<br>E/AndroidRuntime( 538): at android.app.ActivityThread.access$1500(ActivityThread.java:117)<br>E/AndroidRuntime( 538): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)<br>E/AndroidRuntime( 538): at android.os.Handler.dispatchMessage(Handler.java:99)<br>E/AndroidRuntime( 538): at android.os.Looper.loop(Looper.java:123)<br>E/AndroidRuntime( 538): at android.app.ActivityThread.main(ActivityThread.java:3683)<br>E/AndroidRuntime( 538): at java.lang.reflect.Method.invokeNative(Native Method)<br>E/AndroidRuntime( 538): at java.lang.reflect.Method.invoke(Method.java:507)<br>E/AndroidRuntime( 538): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)<br>E/AndroidRuntime( 538): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)<br>E/AndroidRuntime( 538): at dalvik.system.NativeStart.main(Native Method)<br>E/AndroidRuntime( 538): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lua: findLibrary returned null<br>E/AndroidRuntime( 538): at java.lang.Runtime.loadLibrary(Runtime.java:429)<br>E/AndroidRuntime( 538): at java.lang.System.loadLibrary(System.java:554)<br>E/AndroidRuntime( 538): at com.ansca.corona.JavaToNativeShim.<clinit>(JavaToNativeShim.java:93)<br>E/AndroidRuntime( 538): ... 14 more<br>W/ActivityManager( 69): Force finishing activity com.dnsgames.games.shm/com.ansca.corona.CoronaActivity<br>W/ActivityManager( 69): Activity pause timeout for HistoryRecord{4073be28 com.dnsgames.games.shm/com.ansca.corona.CoronaActivity}<br>D/dalvikvm( 69): GC_EXPLICIT freed 55K, 58% free 4365K/10375K, external 5064K/5830K, paused 260ms<br>I/WindowManager( 69): Setting rotation to 0, animFlags=1<br>I/ActivityManager( 69): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=27}<br>D/dalvikvm( 69): GC_EXPLICIT freed 16K, 58% free 4361K/10375K, external 5055K/5830K, paused 110ms<br> [import]uid: 206803 topic_id: 35166 reply_id: 139901[/import]

I’ve searched around this I think the error in the AVD is due to it, probably, being Arm v6 and perhaps it’s not my original error.

If there is no way to make AVD to simulate a Arm 7 device, I have to find a physical device. [import]uid: 206803 topic_id: 35166 reply_id: 139905[/import]

If you download the Google API’s for Android 4.1.2 (in the Android SDK manager) you should be able to select “Nexus 7” from the device list in the AVD manager.

Also make sure that the CPU is set to “ARM (armeabi-v7a)”
If you’re on Mac you should also select “Use Host GPU” for the device to work properly.

EDIT:
You’ll also need to install the “ARM EABI v7a System Image” from the Android SDK Manager [import]uid: 70847 topic_id: 35166 reply_id: 139910[/import]

I got the ADB working and when I run ADB with adb logcat Corona:v \*:s command, command prompt just says I/Corona ( 3541): waiting for connection... and the screen is black. [import]uid: 206803 topic_id: 35166 reply_id: 139919[/import]

I have no idea what that means.

What do you get if you just do adb logcat before starting your app?
It will be very verbose, but there might be some other events that could give a clue to what’s happening…
EDIT:
I just set up a Nexus 7 device in AVD manager and installed one of my apps in the emulator to see what’s happening.
The app is behaving as expected with no weird stuff going on, and the logcat output looks OK… [import]uid: 70847 topic_id: 35166 reply_id: 139921[/import]

Problem was the IDE I was using, when I built my program by manually running Corona simulator, it went fine but for educational purposes I’m eager to know why that debug process with adb went that way that I posted earlier so I can learn from all this for future “black screen of DEATH” situations.

Thanks. [import]uid: 206803 topic_id: 35166 reply_id: 139922[/import]

Aha, so it’s a Glider IDE issue?

Unfortunately I can’t help with that since I don’t use it.
Maybe something that can be reported to M.Y.Developers? [import]uid: 70847 topic_id: 35166 reply_id: 139926[/import]

I think the bug was something very serious that I running abd logcat didn’t result much. [import]uid: 206803 topic_id: 35166 reply_id: 139927[/import]

Interesting…

This may not be an isolated instance. I’m still researching, but oddly starting last evening I started getting a black screen last night on an app that was working fine previously. It seems that it’s only android 4 devices that are failing. It will install fine on my old Kindle Fire, but not my other 2 Android 4 devices. Again, was working fine the day before.

I’m about to run adb and see what’s up. I do build directly from Corona tool, and I do not use Glider ATM. [import]uid: 202223 topic_id: 35166 reply_id: 139947[/import]