[SOLVED] Android apps build but don't run with latest OpenFL and Lime

Since upgrading to OpenFL 2.2.4 and Lime 2.0.6, Android apps produce a black screen and then crash.

Building works fine, as does installation, it’s only when I run the app that it crashes. I’ve tried on a few different devices, and upgraded my Android SDK. I tried PiratePig as well as a few of my own projects, same behaviour on all.

Setting OpenFL back to 2.2.3 and Lime back to 2.0.5 solves the problem.

Are other people experiencing this? Any solutions besides reverting to the old version?

openfl 2.2.4 and lime 2.0.6
i have the problem too

Yes, same here. I tried to look at the ‘adb catlog’ but it’s not understandable for my level. :slight_smile:

Hello! I have the same issue. There’s some segfault happening, here’s the relevant logcat part, I think.
http://pastebin.com/xTDEMHML

If you installed 2.0.6 immediately, you may have gotten a bad build (wasn’t cleaned properly on the build server before the release). You could try haxelib remove lime 2.0.6 && haxelib install lime 2.0.6 to make sure you have the fixed build

3 Likes

Ah, that seems to have solved my crash! Thanks, Granick! However haxeflixel doesn’t seem to run now. I will see if it shows any errors.

Awesome! Let me know what happens with HaxeFlixel, glad to know it’s working, though :slight_smile: :success:

There were no errors, what happened is that no text is displayed. It works if lime is set to version 2.0.0-alpha.
There seems to be some weird stuff with the font embedding in flixel on android. It had to do with font names in the FlxAssets.hx file. On android it expects the asset file path, but on other platforms it wants the font name.

I solved it by adding:

#if android
FONT_DEFAULT = "assets/fonts/nokiafc22.ttf";
FONT_DEBUGGER = "assets/fonts/arial.ttf";
#end

to the init function in FlxAssets.hx. I don’t know if it’s a good solution, but it works. Should i do a pull request or something? I’m new to this stuff.

So going by font name is not working for these on Android?

Doesn’t seem like it. Results in completely empty text fields.

Cross-platform solution:

FONT_DEFAULT = Assets.getFont("assets/fonts/nokiafc22.ttf").fontName;
FONT_DEBUGGER = Assets.getFont("assets/fonts/arial.ttf").fontName;

Of course, now the values can’t be inlined, but it’s not that big a price to pay.

@jefvel If this works for you, I’m interested in what font name values you get for these fonts on Android. The “AddingText” sample works on Android as well as the desktop, using font names, I’m not sure what’s different about this

Based on my own tests, Assets.getFont("assets/fonts/arial.ttf").fontName will return “Arial” in Flash and “assets/fonts/arial.ttf” on all other targets.

I’m having trouble setting the format of specific words; in Flash it works, but it doesn’t work anywhere else. That’s an entirely different issue, though.

Perhaps this depends on whether a @:font has been registered using Font.registerFont, which is done by default for standard embedded fonts

Perhaps we should do this by default for @:font assets as well

Excellent, re-installing lime 2.0.6 solved my problem (apps crashing). Thanks for the help!

Glad to hear, sorry about the trouble :sweat_smile: