OpenFl samples not working for iOS

Hello,

Still struggling to get things working for iOS. After building issues resolved, I’m trying to run the AddingText sample project but i get nothing but a blank white screen on the xcode simulator. Is there something special that needs to be done to get the embed font to work for iOS?

Thanks

1 Like

Hi i had same problem yesterday and i succeed to resolve it by using -Dlegacy directive when compiling from command line and use custom font.

Command:

openfl build "yours project path" -Dlegacy

Sample code:

var t:TextField;
var tf:TextFormat;
var f:Font;

f = Assets.getFont("assets/fonts/vag.TTF");
tf = new TextFormat(f.fontName, 22, 0xffffff);
t = new TextField();
t.defaultTextFormat = tf;
t.text = "Hello";

Thanks for the reply.

I’ll try that.

I’ve noticed that some use openfl and other lime to build, is there a significant difference between using either to build?

Ok that works.

Funny thing is that now on android the app just crashes.

Here is the logcat output. Anyone have any ideas as to why? Thanks

I/ActivityManager(  537): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.openfl.samples.addingtext/.MainActivity (has extras)} from uid 10013 on display 0
I/ActivityManager(  537): Start proc org.openfl.samples.addingtext for activity org.openfl.samples.addingtext/.MainActivity: pid=11335 uid=10088 gids={50088, 9997, 3003} abi=armeabi
I/art     (11335): Late-enabling -Xcheck:jni
W/linker  (11335): liblime.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
I/OpenAL_SLES(11335): alc_opensles_init
V/SDL     (11335): onCreate():null
V/SDL     (11335): onResume()
D/OpenGLRenderer(11335): Render dirty regions requested: true
D/Atlas   (11335): Validating map...
I/Adreno-EGL(11335): : QUALCOMM Build: 10/28/14, c33033c, Ia6306ec328
I/OpenGLRenderer(11335): Initialized EGL, version 1.4
D/OpenGLRenderer(11335): Enabling debug mode 0
V/SDL     (11335): surfaceCreated()
V/SDL     (11335): surfaceChanged()
V/SDL     (11335): pixel format RGB_565
V/SDL     (11335): Window size:1200x1824
I/SDL     (11335): SDL_Android_Init()
I/SDL     (11335): SDL_Android_Init() finished!
W/linker  (11335): libApplicationMain.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
I/haxe plugin(11335): Got Load Proc a259d614
I/haxe plugin(11335): Got Load Proc a259d614
I/haxe plugin(11335): Got Load Proc a259d614
I/haxe plugin(11335): Got Load Proc a259d614
I/OpenAL_SLES(11335): opensles_open_playback pDevice=0xa285e000, deviceName=(null)
I/OpenAL_SLES(11335): alc_opensles_probe DEVICE_PROBE
I/OpenAL_SLES(11335): opensles_reset_playback pDevice=0xa285e000
I/OpenAL_SLES(11335): bits=16, channels=2, samples=1024, size=4096, freq=44100
I/OpenAL_SLES(11335): create audio player
W/AudioTrack(11335): AUDIO_OUTPUT_FLAG_FAST denied by client
W/libc    (11335): pthread_create sched_setscheduler call failed: Operation not permitted
I/OpenAL_SLES(11335): playback_function started
I/OpenAL  (11335): _SC_NPROCESSORS_ONLN=4
D/audio_hw_primary(  183): select_devices: out_snd_device(2: speaker) in_snd_device(0: none)
D/ACDB-LOADER(  183): ACDB -> send_afe_cal
D/audio_hw_primary(  183): enable_snd_device: snd_device(2: speaker)
I/SDL/APP (11335): Added joystick Android Accelerometer with device_id -2147483648
D/audio_hw_primary(  183): enable_audio_route: apply and update mixer path: low-latency-playback
I/ActivityManager(  537): Displayed org.openfl.samples.addingtext/.MainActivity: +428ms
V/SDL     (11335): surfaceChanged()
V/SDL     (11335): pixel format RGB_565
V/SDL     (11335): Window size:1200x1920
--------- beginning of crash
F/libc    (11335): Fatal signal 7 (SIGBUS), code 1, fault addr 0xa20451d9 in tid 11359 (SDLThread)
I/DEBUG   (  181): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  181): Build fingerprint: 'google/razor/flo:5.0.2/LRX22G/1649326:user/release-keys'
I/DEBUG   (  181): Revision: '0'
I/DEBUG   (  181): ABI: 'arm'
I/DEBUG   (  181): pid: 11335, tid: 11359, name: SDLThread  >>> org.openfl.samples.addingtext <<<
I/DEBUG   (  181): signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xa20451d9
I/DEBUG   (  181):     r0 a2044f20  r1 00000006  r2 a2044994  r3 a20451d5
I/DEBUG   (  181):     r4 a280ecd8  r5 000002b5  r6 a20451e9  r7 00000010
I/DEBUG   (  181):     r8 00000014  r9 00000010  sl 00000154  fp 00000042
I/DEBUG   (  181):     ip a26de450  sp a2a26750  lr a259c13c  pc a3dcbd24  cpsr 20000010
I/DEBUG   (  181):
I/DEBUG   (  181): backtrace:
I/DEBUG   (  181):     #00 pc 00029d24  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #01 pc 00029e08  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #02 pc 00023f20  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #03 pc 004ac5e4  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (ExternalPrimitive::__run(Dynamic const&, Dynamic const&, Dynamic const&)+404)
I/DEBUG   (  181):     #04 pc 000edbf8  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (Dynamic::operator()(Dynamic const&, Dynamic const&, Dynamic const&)+88)
I/DEBUG   (  181):     #05 pc 00427d9c  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::text::Font_obj::renderGlyphs(Array, int)+876)
I/DEBUG   (  181):     #06 pc 00207478  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::_internal::renderer::opengl::GLTextField_obj::update(hx::ObjectPtr)+2672)
I/DEBUG   (  181):     #07 pc 00203860  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::_internal::renderer::opengl::GLTextField_obj::render(hx::ObjectPtr, hx::ObjectPtr)+272)
I/DEBUG   (  181):     #08 pc 000844bc  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::text::TextField_obj::__renderGL(hx::ObjectPtr)+160)
I/DEBUG   (  181):     #09 pc 004510e4  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObjectContainer_obj::__renderGL(hx::ObjectPtr)+1072)
I/DEBUG   (  181):     #10 pc 004510e4  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObjectContainer_obj::__renderGL(hx::ObjectPtr)+1072)
I/DEBUG   (  181):     #11 pc 004510e4  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::display::DisplayObjectContainer_obj::__renderGL(hx::ObjectPtr)+1072)
I/DEBUG   (  181):     #12 pc 00210088  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::_internal::renderer::opengl::GLRenderer_obj::renderDisplayObject(hx::ObjectPtr, hx::ObjectPtr, hx::ObjectPtr)+716)
I/DEBUG   (  181):     #13 pc 0020fd30  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::_internal::renderer::opengl::GLRenderer_obj::render(hx::ObjectPtr)+1120)
I/DEBUG   (  181):     #14 pc 001274c0  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (openfl::display::Stage_obj::render(hx::ObjectPtr)+820)
I/DEBUG   (  181):     #15 pc 00135f58  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::app::IModule_delegate_::render(hx::ObjectPtr)+72)
I/DEBUG   (  181):     #16 pc 003b27e8  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::app::Application_obj::render(hx::ObjectPtr)+396)
I/DEBUG   (  181):     #17 pc 003bc884  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::app::__Module_objrender(hx::Object*, Dynamic const&)+72)
I/DEBUG   (  181):     #18 pc 004dd508  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (hx::CMemberFunction1::__run(Dynamic const&)+64)
I/DEBUG   (  181):     #19 pc 00071580  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (Dynamic::operator()(Dynamic const&)+72)
I/DEBUG   (  181):     #20 pc 003da83c  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::_backend::native::NativeApplication_obj::handleRenderEvent()+988)
I/DEBUG   (  181):     #21 pc 003db2b4  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::_backend::native::__NativeApplication_objhandleRenderEvent(hx::Object*)+40)
I/DEBUG   (  181):     #22 pc 004dcf64  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (hx::CMemberFunction0::__run()+56)
I/DEBUG   (  181):     #23 pc 0047220c  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (val_call0+56)
I/DEBUG   (  181):     #24 pc 00039254  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #25 pc 00036398  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #26 pc 00035d24  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #27 pc 00022e40  /data/app/org.openfl.samples.addingtext-2/lib/arm/liblime.so
I/DEBUG   (  181):     #28 pc 004ac1e0  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (ExternalPrimitive::__run(Dynamic const&)+360)
I/DEBUG   (  181):     #29 pc 00071580  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (Dynamic::operator()(Dynamic const&)+72)
I/DEBUG   (  181):     #30 pc 003d6e78  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::_backend::native::NativeApplication_obj::exec()+724)
I/DEBUG   (  181):     #31 pc 003aeb60  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (lime::app::Application_obj::exec()+192)
I/DEBUG   (  181):     #32 pc 0046c494  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::create()+992)
I/DEBUG   (  181):     #33 pc 0046d51c  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (ApplicationMain_obj::main()+260)
I/DEBUG   (  181):     #34 pc 0046f584  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (hxcpp_main+40)
I/DEBUG   (  181):     #35 pc 0046f678  /data/app/org.openfl.samples.addingtext-2/lib/arm/libApplicationMain.so (Java_org_haxe_HXCPP_main+12)
I/DEBUG   (  181):     #36 pc 000000c1  /data/dalvik-cache/arm/data@[email protected]@[email protected]
I/AudioFlinger(  183): BUFFER TIMEOUT: remove(4098) from active list on thread 0xb5b22000
W/ActivityManager(  537):   Force finishing activity org.openfl.samples.addingtext/.MainActivity
I/DEBUG   (  181):
I/DEBUG   (  181): Tombstone written to: /data/tombstones/tombstone_05
I/BootReceiver(  537): Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
W/AudioTrack(11335): releaseBuffer() track 0xa2875300 disabled due to previous underrun, restarting
E/SharedPreferencesImpl(  537): Couldn't create directory for SharedPreferences file shared_prefs/log_files.xml
I/WindowState(  537): WIN DEATH: Window{14ee2ccf u0 org.openfl.samples.addingtext/org.openfl.samples.addingtext.MainActivity}
I/WindowState(  537): WIN DEATH: Window{84c8c60 u0 SurfaceView}
I/Zygote  (  195): Process 11335 exited due to signal (7)
I/ActivityManager(  537): Process org.openfl.samples.addingtext (pid 11335) has died

Not sure i’m really new to haxe and openfl.

For me previous example works on both targets (ios - Android)

This is getting weird. When building on android now, i see this compile error. Having done nothing other than add or remove the -Dlegacy flag.

I’m using the command lime build android -Dlegacy, this worked before.

-compile:
    [javac] Compiling 6 source files to C:\development\haxe\samples\AddingText\Export\android\bin\bin\classes
    [javac] C:\development\haxe\samples\AddingText\Export\android\bin\src\org\haxe\lime\MainView.java:711: error: cannot find symbol
    [javac]                     Sound.checkSoundCompletion ();
    [javac]                     ^
    [javac]   symbol:   variable Sound
    [javac]   location: class Renderer
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 error

@mpgdev Try updating your versions, it sounds like you’re using an older Lime and OpenFL release

Ok,

Dumb question - I installed lime and openfl using these commands -

haxelib install lime
haxelib run lime setup
lime install openfl

Do i use those commands again to update or is there a different command?

Thanks

You can do haxelib update lime && haxelib update openfl or haxelib upgrade to update every lib.