Crash on android devices on attempt to set text into TextField

Hi.
I got crash of app on android devices when I try to set text in TextField.
This line kill app:
someTextField.text=“TEST”;

What I use:
Haxe Compiler 3.2.0
actuate: [1.8.6]
box2d: [1.2.3]
hxcpp: [3.2.180]
layout: [1.2.1]
lime-samples: [2.6.0]
lime: [2.6.8]
openfl-samples: [3.3.1]
openfl: [3.3.8]
swf: [2.1.1]

Tested on devices:
Samsung Galaxy S3
Samsung Galaxy A7

Does the “AddingText” or “PiratePig” sample work for you?

Any text which I try set into TextField make my app crash.
Also I made mistake when write spec of my configuration. I use “lime-2.6.8-14-g0cb8cd1.zip” ( http://www.openfl.org/builds/lime/lime-2.6.8-14-g0cb8cd1.zip1 ).

Bump! I found similar problem. Android app crashes when I try to set text on a textfield with no font set through TextFormat. This is for the Next, on Legacy it works fine. I tried the PiratePig sample and the results are as follows.

When embedFonts is false and font is not set the error is:

                  libc  F  Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa1501354 in tid 13181 (SDLThread)
                 DEBUG  I  #00 pc 0024f006  /system/lib/libart.so (art::ConvertUtf16ToModifiedUtf8(char*, unsigned short const*, unsigned int)+29)
                        I  #01 pc 001bb57f  /system/lib/libart.so (art::JNI::GetStringUTFChars(_JNIEnv*, _jstring*, unsigned char*)+334)
                        I  #02 pc 000bd403  /system/lib/libart.so (art::CheckJNI::GetStringUTFChars(_JNIEnv*, _jstring*, unsigned char*)+82)
                        I  #03 pc 0005d6fd  /system/lib/libandroid_runtime.so
                        I  #04 pc 00082f83  /system/lib/libandroid_runtime.so
                        I  #05 pc 0051f82b  /system/framework/arm/boot.oat

When embedFonts is true but the font is not set then this happens:

libc  F  Fatal signal 11 (SIGSEGV), code 1, fault addr 0xe58dc00c in tid 15571 (SDLThread)
                 DEBUG  I  #00 pc 000144ee  /system/lib/libc.so (pthread_mutex_lock+7)
                        I  #01 pc 0003f413  /system/lib/libc.so (je_arena_dalloc_large+14)
                        I  #02 pc 000471c9  /system/lib/libc.so (ifree+700)
                        I  #03 pc 0000fbc3  /system/lib/libc.so (free+10)
                        I  #04 pc 0003883c  /data/app/org.openfl.samples.piratepig-2/lib/arm/liblime.so
                        I  #05 pc 00538334  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (lime::_system::System_obj::get_fontsDirectory()+204)
                        I  #06 pc 0025bb44  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::_internal::text::TextEngine_obj::getFontInstance(hx::ObjectPtr<openfl::text::TextFormat_obj>)+1012)
                        I  #07 pc 002525c4  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::_internal::text::TextEngine_obj::getLayoutGroups()+1624)
                        I  #08 pc 0025a6a0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::_internal::text::TextEngine_obj::update()+1528)
                        I  #09 pc 000ce0f4  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::text::TextField_obj::__updateLayout()+212)
                        I  #10 pc 000c8464  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::text::TextField_obj::__getBounds(hx::ObjectPtr<openfl::geom::Rectangle_obj>, hx::ObjectPtr<openfl::geom::Matrix_obj>)+144)
                        I  #11 pc 008e5bc0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObjectContainer_obj::__getBounds(hx::ObjectPtr<openfl::geom::Rectangle_obj>, hx::ObjectPtr<openfl::geom::Matrix_obj>)+1328)
                        I  #12 pc 00903c88  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObject_obj::get_width()+444)
                        I  #13 pc 0008722c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (piratepig::PiratePigGame_obj::resize(int, int)+364)
                        I  #14 pc 008dc604  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (piratepig::PiratePig_obj::resize(int, int)+436)
                        I  #15 pc 008dbb38  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (piratepig::PiratePig_obj::__construct()+348)
                        I  #16 pc 008dafe0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (DocumentClass_obj::__construct()+256)
                        I  #17 pc 008db240  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (DocumentClass_obj::__Create(Array<Dynamic>)+88)
                        I  #18 pc 0098c180  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (hx::Class_obj::ConstructArgs(Array<Dynamic>)+60)
                        I  #19 pc 008ac744  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (Type_obj::createInstance(hx::ObjectPtr<hx::Class_obj>, hx::ObjectPtr<hx::ArrayBase>)+240)
                        I  #20 pc 00916adc  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::start()+1040)
                        I  #21 pc 0091576c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::init()+372)
                        I  #22 pc 009157e0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (__ApplicationMain_objinit()+12)
                        I  #23 pc 0099195c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (hx::CStaticFunction0::__run()+32)
                        I  #24 pc 002293a0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (Dynamic::operator()()+64)
                        I  #25 pc 00873e3c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (lime::app::Event_Void_Void_obj::dispatch()+464)
                        I  #26 pc 007ddefc  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (lime::app::Preloader_obj::start()+192)
                        I  #27 pc 001ec5bc  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::Preloader_obj::display_onComplete(hx::ObjectPtr<openfl::events::Event_obj>)+664)
                        I  #28 pc 001ec65c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::__Preloader_objdisplay_onComplete(hx::Object*, Dynamic const&)+68)
                        I  #29 pc 00991d30  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (hx::CMemberFunction1::__run(Dynamic const&)+64)
                        I  #30 pc 00072cd0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (Dynamic::operator()(Dynamic const&)+72)
                        I  #31 pc 009122c8  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::events::EventDispatcher_obj::__dispatchEvent(hx::ObjectPtr<openfl::events::Event_obj>)+2208)
                        I  #32 pc 008f2ce0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObject_obj::__dispatchEvent(hx::ObjectPtr<openfl::events::Event_obj>)+172)
                        I  #33 pc 00910440  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::events::EventDispatcher_obj::dispatchEvent(hx::ObjectPtr<openfl::events::Event_obj>)+456)
                        I  #34 pc 008b795c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (NMEPreloader_obj::onLoaded()+288)
                        I  #35 pc 001ebff8  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (openfl::display::Preloader_obj::start()+860)
                        I  #36 pc 007ddbe4  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (lime::app::Preloader_obj::create(Dynamic)+132)
                        I  #37 pc 0091518c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::create()+828)
                        I  #38 pc 00916610  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::main()+184)
                        I  #39 pc 00918bac  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (__hxcpp_main+4)
                        I  #40 pc 00918ac0  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (hxcpp_main+40)
                        I  #41 pc 00918b9c  /data/app/org.openfl.samples.piratepig-2/lib/arm/libApplicationMain.so (Java_org_haxe_HXCPP_main+12)
                        I  #42 pc 000000c1  /data/dalvik-cache/arm/data@[email protected]@[email protected]

I guess it is supposed to use default system font just like in Legacy but it crashes.
The versions are:
haxe: [3.2.1]
hxcpp: [3.3.49]
lime-samples: [2.6.0]
lime: [2.9.1]
openfl-samples: [3.3.1]
openfl: [3.6.1]

This is getting old. Use lime 2.9.0
There are several threads about this already, and several github issues.
Search first.

Has anyone tested to see if this is fixed in current development builds? I have not seen crashes like this on text

@MiltonW Strange because I didn’t find any threads with similar errors. FYI I’m using lime 2.9.1

@singmajesty I can only confirm that this has appeared in lime 2.9.1, the previous 2.9.0 is fine

Use google: ‘openfl textfield crash’. First 4 hits.

If you read my post carefully you will see that those ‘first 4 hits’ are not so relevant or miss important information that I have provided. I’m not desperately looking for help, downgraded to 2.9.0 and that suits me. I’m just leaving my findings with hope that this will help someone fix this issue.

I’m using development builds of lime/openfl, and TextFields work properly for me on Android (whereas 2.9.0/2.9.1 caused crashes).

1 Like

On second thought, I’m not so sure. Sorry. I’ll run tests and see if I can isolate the problem (which, it seems, is the fact that Times New Roman, the default font, is not available on Android)