So after several months I am coming back to my project and when trying to test on iOS the app simply generates a black screen. I can all the traces working but black/white screen only. Previously the app was launching without any issues. Looking at logs provides no information that I can see. Anyone else have experience with this and was able to fix it?
Been searching all over the web and can’t find any info on this. Asset paths is the closest I saw to this black screen issue but that is not what my problem is. I wish I could remember what the version that previously ran was, I have since updated my haxe libraries. Any help will be greatly appreciated.
What Openfl and lime version?
on 9.3.2. Currently I am looking into rebuilding the app step by step to see if it is maybe one of these libs causing the issue:
feathersUI (Doubtful)
SpriterHaxeEngine (possible)
svg
I was thinking perhaps it is an issue with the SQLite running in the app but have yet to test all this. I write a new main.hx in the same app that loads a simple sprite and it does not work. When creating a whole new app and running the same sprite loading code it works on iOS.
After some debugging it appears that SpriterHaxeEngine is the culprit with my black screen issue. Built a sample with hat lib and got the same black screen. After going back and looking at the compatibility I noticed iOS is not listed and this could be why I am having this issue. Can anyone recommend a free open source animation tool that can be used with openFL? I tried looking for DragonBones but I cannot find that tool anymore.
You can use that config:
<define name="HXCPP_DEBUG_LINK" />
<define name="HXCPP_STACK_TRACE" />
<define name="HXCPP_STACK_LINE" />
<define name="HXCPP_CHECK_POINTER" />
This way you can get some additional information.
Thanks. So this is what is printed out:
Cache loaded with 5598 pre-cached in CacheData and 64 items in CacheExtra.
AggregateDictionary is deprecated and has been removed. Please migrate to Core Analytics.
oalImp.cpp:674 alcOpenDevice
cannot migrate AudioUnit assets for current process
oalImp.cpp:787 alcCreateContext--> device = 24
muse not set on product node
oalImp.cpp:840 alcMakeContextCurrent--> context = 25
oalImp.cpp:906 alcProcessContext--> context = 25
Metal GPU Frame Capture Enabled (/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture)
Metal API Validation Enabled
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x14a9ce400>.
Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x14a9ce400>.
Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x14a9ce400>.
Unbalanced calls to begin/end appearance transitions for <SDL_uikitviewcontroller: 0x14a9ce400>.
fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
As additional info I enabled feathersUI on a separate test and that too generated a black screen.
You can use spine-hx and openfl-spine
Emm, It doesn’t seem like it’s a problem with HXCPP.
That is just great LOL I have no idea where to even start looking. Anytime I add a library to a new project the screen ends up black on iOS. CPP and Neko work fine.
This does not make sense. I have built several tests and some work and others don’t but I cannot nail down what is causing it. No log info is available that can give me a clue on what causes the black screen. This is what I get and this is extremely frustrating. I hate to throw in the towel on this and start over with a different language being that so much work went into this already. Not sure what to do at this point.
You can provide a sample of the problem, and I can help you take a look.
Currently rebuilding the app step by step to see where the build is failing. Will post more info as soon as I get something that can be reproduced consistently. Thanks for the help so far @rainy
I got my app working. I reinstalled Haxe and Xcode and created a new project. I moved all the code over to the new directory and now the app is actually running. When I tried to run the original code location it still generates a black screen but the new directory works fine. I moved everything one section at a time to see where it was failing but everything worked. I am thinking the issue may have actually been in Xcode and reinstalling it fixed whatever was broken.
I was able to successfully run the Feathers UI components-explorer sample on an iPhone SE (2020) using the following software versions.
Haxe 4.3.3
hxcpp 4.3.2
OpenFL 9.3.2
Lime 8.1.1
Feathers UI 1.2.0
Xcode 15
macOS Sonoma 14.1.2
Did you ever try adding the -clean
command line option when building from this old location? Maybe something was cached from a previous build, and it was messing up new builds. In the new location, there would be nothing cached in the first place, so that could explain the difference.
Alternatively, instead of adding -clean
, you could delete your output directory (usually called Export or bin), and then try building again.
Yes I tried clearing the directory but same result with the black screen in the original directory.
I found what causes the screen to go black on iOS. When adding background=“0xFFFFFF” to the project.xml the screen turns black removing it renders the app graphics without any problems.
In the project.xml docs, the sample for <window>
uses a #
character for the background color instead of 0x
. Maybe give that a try.
<window background="#FFFFFF"/>