HaxeFlixel / HaxeFlixel/flixel

Black screen on some Android devices

Open
#2,173 34 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

  • Haxe version: 3.4.188
  • Flixel version: 4.5.1
  • OpenFL version: 8.3.0
  • Lime version: 6.4.0
  • Affected targets: android
  • Android NDK: r10e

I built and launched the FlxCaveGenerator sample on an old testing device (Nexus S (crespo), Android 4.4.2) and I get the HaxeFlixel splashscreen (complete with sound) and a black screen afterwards. I stumbled on this while porting a game of mine to the last HaxeFlixel.

The sample works on 4.3.0 (with openfl 3.6.1 and lime 2.9.1 ofc).

OpenFL/Lime samples (tested with openfl 8.4.0 and 8.3.0) do not show the issue, so it seems a regression in HaxeFlixel.

Also, both the sample and my game work on android emulator with a KitKat image (both with shifted colors, but that is an OpenFL issue).

This is the adb logcat on non working device:

V/Zygote ( 3349): Switching descriptor 32 to /dev/null
V/Zygote ( 3349): Switching descriptor 9 to /dev/null
D/dalvikvm( 3349): Late-enabling CheckJNI
I/ActivityManager( 436): Start proc com.example.myapp for activity com.example.myapp/.MainActivity: pid=3349 uid=10061 gids={50061, 3003}
I/dalvikvm( 3349): Could not find method org.libsdl.app.SDLActivity.onRequestPermissionsResult, referenced from method org.haxe.lime.GameActivity.onRequestPermissionsResult
W/dalvikvm( 3349): VFY: unable to resolve virtual method 422: Lorg/libsdl/app/SDLActivity;.onRequestPermissionsResult (I[Ljava/lang/String;[I)V
D/dalvikvm( 3349): VFY: replacing opcode 0x6f at 0x0019
V/SDL ( 3349): Device: crespo
V/SDL ( 3349): Model: Nexus S
V/SDL ( 3349): onCreate()
D/dalvikvm( 3349): Trying to load lib /data/app-lib/com.example.myapp-2/liblime.so 0x41ece3b0
W/SDL ( 3349): Request to get environment variables before JNI is ready
D/dalvikvm( 3349): Added shared lib /data/app-lib/com.example.myapp-2/liblime.so 0x41ece3b0
D/dalvikvm( 3349): Trying to load lib /data/app-lib/com.example.myapp-2/libApplicationMain.so 0x41ece3b0
D/dalvikvm( 3349): Added shared lib /data/app-lib/com.example.myapp-2/libApplicationMain.so 0x41ece3b0
D/dalvikvm( 3349): No JNI_OnLoad found in /data/app-lib/com.example.myapp-2/libApplicationMain.so 0x41ece3b0, skipping init
V/SDL ( 3349): nativeSetupJNI()
V/SDL ( 3349): AUDIO nativeSetupJNI()
V/SDL ( 3349): CONTROLLER nativeSetupJNI()
V/SDL ( 3349): onResume()
D/OpenGLRenderer( 3349): Enabling debug mode 0
V/SDL ( 3349): surfaceCreated()
V/SDL ( 3349): surfaceChanged()
V/SDL ( 3349): pixel format RGB_565
V/SDL ( 3349): Window size: 800x480
V/SDL ( 3349): nativeResume()
V/SDL ( 3349): Running main function hxcpp_main from library libApplicationMain.so
V/SDL ( 3349): nativeRunMain()
V/SDL ( 3349): onWindowFocusChanged(): true
I/ActivityManager( 3349): Timeline: Activity_idle id: android.os.BinderProxy@41ecaf80 time:1064532
I/haxe plugin( 3349): Got Load Proc 56031bac
E/libEGL ( 3349): validate_display:254 error 3008 (EGL_BAD_DISPLAY)
V/SDL ( 3349): setOrientation() orientation=-1 width=800 height=480 resizable=true hint=
D/dalvikvm( 3349): threadid=13: thread exiting, not yet detached (count=0)

For comparison purposes, this is the adb logcat of a working device (Nexus 5, Android 6.0.1):

09-17 18:05:11.983 810 2042 I ActivityManager: Start proc 32231:com.example.myapp/u0a122 for activity com.example.myapp/.MainActivity
09-17 18:05:11.986 32231 32231 I art : Late-enabling -Xcheck:jni
09-17 18:05:12.319 32231 32231 V SDL : Device: hammerhead
09-17 18:05:12.319 32231 32231 V SDL : Model: Nexus 5
09-17 18:05:12.319 32231 32231 V SDL : onCreate()
09-17 18:05:12.344 32231 32231 W SDL : Request to get environment variables before JNI is ready
09-17 18:05:12.352 32231 32231 V SDL : nativeSetupJNI()
09-17 18:05:12.352 32231 32231 V SDL : AUDIO nativeSetupJNI()
09-17 18:05:12.352 32231 32231 V SDL : CONTROLLER nativeSetupJNI()
09-17 18:05:12.451 32231 32231 V SDL : onResume()
09-17 18:05:12.491 32231 32253 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
09-17 18:05:13.452 32231 32253 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
09-17 18:05:13.461 32231 32253 I OpenGLRenderer: Initialized EGL, version 1.4
09-17 18:05:13.491 32231 32231 V SDL : surfaceCreated()
09-17 18:05:13.491 32231 32231 V SDL : surfaceChanged()
09-17 18:05:13.491 32231 32231 V SDL : pixel format RGB_565
09-17 18:05:13.491 32231 32231 V SDL : Window size: 1920x1080
09-17 18:05:13.504 32231 32231 V SDL : nativeResume()
09-17 18:05:13.504 32231 32275 V SDL : Running main function hxcpp_main from library libApplicationMain.so
09-17 18:05:13.504 32231 32275 V SDL : nativeRunMain()
09-17 18:05:13.522 32231 32275 I haxe plugin: Got Load Proc a195abac
09-17 18:05:13.549 32231 32231 V SDL : onWindowFocusChanged(): true
09-17 18:05:13.609 32231 32275 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, output 48000 Hz
09-17 18:05:13.780 32231 32275 E libEGL : validate_display:255 error 3008 (EGL_BAD_DISPLAY)
09-17 18:05:13.781 32231 32275 V SDL : setOrientation() orientation=-1 width=1920 height=1080 resizable=true hint=
09-17 18:05:13.920 32231 32283 W art : Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[13,tid=32283,Native,Thread*=0xacb26c00,peer=0x12df80a0,"Thread-1018"]

Update: this is the logcat of the emulator (working):

I/ActivityManager( 401): Start proc com.example.myapp for activity com.example.myapp/.MainActivity: pid=1159 uid=10053 gids={50053, 3003}
D/dalvikvm( 1159): Not late-enabling CheckJNI (already on)
I/dalvikvm( 1159): Could not find method org.libsdl.app.SDLActivity.onRequestPermissionsResult, referenced from method org.haxe.lime.GameActivity.onRequestPermissionsResult
W/dalvikvm( 1159): VFY: unable to resolve virtual method 422: Lorg/libsdl/app/SDLActivity;.onRequestPermissionsResult (I[Ljava/lang/String;[I)V
D/dalvikvm( 1159): VFY: replacing opcode 0x6f at 0x0019
V/SDL ( 1159): Device: generic
V/SDL ( 1159): Model: sdk
V/SDL ( 1159): onCreate()
D/dalvikvm( 1159): Trying to load lib /data/app-lib/com.example.myapp-1/liblime.so 0xb0817358
W/SDL ( 1159): Request to get environment variables before JNI is ready
D/dalvikvm( 1159): Added shared lib /data/app-lib/com.example.myapp-1/liblime.so 0xb0817358
D/dalvikvm( 1159): Trying to load lib /data/app-lib/com.example.myapp-1/libApplicationMain.so 0xb0817358
D/dalvikvm( 1159): Added shared lib /data/app-lib/com.example.myapp-1/libApplicationMain.so 0xb0817358
D/dalvikvm( 1159): No JNI_OnLoad found in /data/app-lib/com.example.myapp-1/libApplicationMain.so 0xb0817358, skipping init
V/SDL ( 1159): nativeSetupJNI()
V/SDL ( 1159): AUDIO nativeSetupJNI()
V/SDL ( 1159): CONTROLLER nativeSetupJNI()
V/SDL ( 1159): onResume()
D/ ( 1159): HostConnection::get() New Host Connection established 0xb785f7d0, tid 1159
D/OpenGLRenderer( 1159): Enabling debug mode 0
V/SDL ( 1159): surfaceCreated()
V/SDL ( 1159): surfaceChanged()
V/SDL ( 1159): pixel format RGB_565
V/SDL ( 1159): Window size: 800x480
V/SDL ( 1159): nativeResume()
V/SDL ( 1159): Running main function hxcpp_main from library libApplicationMain.so
V/SDL ( 1159): nativeRunMain()
V/SDL ( 1159): onWindowFocusChanged(): true
I/haxe plugin( 1159): Got Load Proc a670bbac
E/libEGL ( 1159): validate_display:254 error 3008 (EGL_BAD_DISPLAY)
V/SDL ( 1159): setOrientation() orientation=-1 width=800 height=480 resizable=true hint=
D/ ( 1159): HostConnection::get() New Host Connection established 0xb78fb4a0, tid 1174
D/dalvikvm( 1159): threadid=13: thread exiting, not yet detached (count=0)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the FlxCaveGenerator sample on the Nexus S with Android 4.4.2 and compare its adb logcat with the working emulator and Nexus 5 logs. Trace the HaxeFlixel, OpenFL, and Lime startup path around the Android rendering regression; done means the sample renders after the splash screen on the affected device.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.