Android build shows a black screen and I can't find error message

Hi everyone,

I’m trying to build a project for android. It seems to build fine and it installs, the sound plays but then the screen is black.
I’m testing with Mode demo from HaxeFlixel.

flixel-addons: [2.0.0]
flixel-demos: [2.1.0]
flixel-templates: [2.0.1]
flixel-tools: 1.1.2 [1.1.3]
flixel-ui: [2.0.0]
flixel: [4.0.1]
hscript: [2.0.7]
hxcpp: 3.2.102 [3.2.205]
layout: [1.2.1]
lime-samples: [2.6.0]
lime: [2.9.1]
nape: 2.0.16 2.0.17 [2.0.20]
openfl-samples: [3.3.1]
openfl: [3.6.1]
swf: [2.2.0]

I’m testing on a Nexus 6p

This is the full log from the build to a few minutes of activity. I can’t find an error message so I’m lost.

Do any of Flixel’s sample projects work? How about OpenFL’s samples?

I tried bunny mark and it is visibly crashing. I didn’t try the other Flixel demos.

Maybe it is something about compilation?

I’m using jdk1.7.0_79

What does “visibly crashing” mean? Does it show up for a second and then crash? And is there an error message this time?

I’d try testing DisplayingABitmap. Keep this as simple as possible and see if it still crashes. Also, check if OpenGL is throwing an error.

Thanks for the help but:

On the bunny mark crash there is an android sign that says that the app crashed.

Displaying a bitmap is working fine.

OpenGl doesn’t seem to the throwing errors.

Usually when that happens, there’s a stack trace in the log. Have you checked for one?

This suggests that the problem is something to do with Flixel. However, I tested FlxBunnyMark on my Nexus 6, and it ran fine. (My only change was commenting out FLX_NO_MOUSE, because that made it fail to compile.)

Try testing different sample projects until you find the simplest one that fails. Either that, or comment out lines of FlxBunnyMark until it stops crashing.

The crash is with openfl bunnymark, not flixels

This is the crash log but I don’t understand what is wrong:

I noticed that it is not crashing when I comment the line that ads the FPS counter. Maybe there is some problem with textFields?

I could believe that. I’ve heard that text support in OpenFL Next isn’t quite done. What happens if you uncomment that line but add <set name="openfl-legacy" /> in project.xml? (Add this above the line that includes OpenFL as a haxelib.)

adding that line ends the compilation with this error:
C:/HaxeToolkit/haxe/lib/openfl/3,6,1/openfl/_internal/renderer/RenderSession.hx:4: characters 7-39 : Type not found :

Odd. Can you make sure CairoRenderContext.hx and Cairo.hx are both present?

Yes, they are present.

I did the setup on another computer with mac os x el capitan and the same problems. Before I used a Windows 10 computer.

Finally it worked. I had to update android ndk and downgrade lime to 2.9.0

@singmajesty, excuse me, I think the android libraries included with openfl are outdated and causing problems.

lime 2.9.1 crashes when you try to get font directory on Android. I’ve found it and fixed it. I may make PR later.