Hello!
I’m creating a BlackBerry 10 app using OpenFl and its been going well until recently. Last week, I upgraded my device to the latest OS version (10.3.1.1581) and now my app doesn’t exit properly.
The precise behaviour is this:
The first time I open my app on my Z10, it runs fine. But when I try to exit, the window it’s been running in disappears and the app icon becomes faded and semi-transparent (like it’s got an alpha of 0.5 or so). Normally, the icon doesn’t look like this.
From doing some research, I believe the fading indicates that the app didn’t close properly. If I click on the icon, nothing happens. I can’t open my app again without restarting my BlackBerry device. Any ideas what’s going on?
The weird thing is that my app was working just fine on an earlier developer build of 10.3.1 (10.3.1.364, I believe).
I’ve tested with a simple Hello World app & got the same bug. The follow steps should be enough to reproduce it:
- Update your BB10 device to the latest OS (10.3.1.1581) via Settings > Software Updates
- Open FlashDevelop and create a new OpenFl project that uses a standard template.
- Do a debug or release build of the project for the BlackBerry target.
- Install the resulting BAR file on your BB10 device and click on the icon to open it.
- Once the app is open, do the swipe gesture to put it into the background.
- Press on the X to close the app.
- The app icon should now look faded. Clicking on it won’t open the app again. You’re stuck unless you restart your device.
Any ideas what’s going on?
I know about the log file on BlackBerry devices & I checked it to see if had an error messages. I did not.
This leads me to believe that the app isn’t actually crashing Instead, it’s actually in some sort of “limbo” state where it hasn’t fully closed but is unresponsive.
Checking out the BlackBerry developer forums, I came across a few other people with the same issue.
Unfortunately, the solutions suggested involved directly adding new c++ code.
My current hunch is that the source of the bug is either:
- Because I’m compiling with the old PlayBook OS NDK rather than the newer BB10 NDK.
- An issue with a “broken” library - similar to the issue with BB 10.3 that Joshua alludes to here.
I’m currently trying to update from the BlackBerry Native SDK to the BB10 NDK & use it with OpenFl but am having trouble doing this.
Here are the steps I’ve taken:
-
Downloaded the latest BB10 NDK 10.3.1
-
First, I simply tried executing the command “lime setup blackberry” & pointing to the directory of the new SDK when prompted for “Path of BlackBerry Native SDK”.
But this didn’t work & I got an error message along the lines of “Could not find bbndk-env.bat” -
I noticed that the new BB10 NDK had the file “bbndk_10_3_1_995.bat” so I searched the source code of both Openfl and Lime and found that five files that included the following line:
fileName += “\bbndk-env.bat”;
So, I manually changed it to:
fileName += “\bbndk-env_10_3_1_995.bat”;
The files are:
setup.hx
platformSetup.hx (There are 2 copies one in lime/tools & one in openfl-tools)
blackBerryHelper.hx (There are 2 copies one in lime/tools & one in openfl-tools)
Next, I executed the following commands from the command line:
- “lime rebuild tools”
- “lime setup blackberry”
I then went back into FlashDevelop & tried to build a simple program for the blackberry target.
The compilation process didn’t spit out the previous error & got much further. But eventually, it stopped with the following error:
ntoarmv7-g++ -Iinclude -c -g -IC:/HaxeToolkit/haxe/lib/hxcpp/3,1,48/include -I%BASE_DIR_REPLACED%/target_10_3_1_995/qnx6/usr/include -DBLACKBERRY=BLACKBERRY -fvisibility=hidden -fdollars-in-identifiers -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -fpic -fPIC -x c++ -frtti ./src/sys/io/FileOutput.cpp -o./obj/blackberry-debug-v7/b6bb5383_FileOutput.o
ntoarmv7-g++ -Iinclude -c -g -IC:/HaxeToolkit/haxe/lib/hxcpp/3,1,48/include -I%BASE_DIR_REPLACED%/target_10_3_1_995/qnx6/usr/include -DBLACKBERRY=BLACKBERRY -fvisibility=hidden -fdollars-in-identifiers -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -fpic -fPIC -x c++ -frtti ./src/sys/io/File.cpp -o./obj/blackberry-debug-v7/b6bb5383_File.o
ntoarmv7-g++ -Iinclude -c -g -IC:/HaxeToolkit/haxe/lib/hxcpp/3,1,48/include -I%BASE_DIR_REPLACED%/target_10_3_1_995/qnx6/usr/include -DBLACKBERRY=BLACKBERRY -fvisibility=hidden -fdollars-in-identifiers -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -fpic -fPIC -x c++ -frtti ./src/openfl/text/TextFieldType.cpp -o./obj/blackberry-debug-v7/179d51f1_TextFieldType.o
Process creation failure : ntoarmv7-g++
ntoarmv7-g++ -Iinclude -c -g -IC:/HaxeToolkit/haxe/lib/hxcpp/3,1,48/include -I%BASE_DIR_REPLACED%/target_10_3_1_995/qnx6/usr/include -DBLACKBERRY=BLACKBERRY -fvisibility=hidden -fdollars-in-identifiers -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -fpic -fPIC -x c++ -frtti ./src/openfl/utils/Endian.cpp -o./obj/blackberry-debug-v7/9bb80065_Endian.o
Build halted with errors (haxelib.exe).
I think the issue is that %BASE_DIR_REPLACED% is not being set an environment variable. If so, how can I fix this. Can I try to do it manually?
When I trace Sys.environment, I get “#function0”
When I trace project.environment inside blackBerryHelper.hx, I get the following:
project.environment={NEKO_INSTPATH => C:\HaxeToolkit\neko, Platform => BNB, USERDOMAIN => PI, LOCALAPPDATA => C:\Users\dpope\AppData\Local, PROCESSOR_ARCHITECTURE => x86, ProgramFiles(x86) => C:\Program Files (x86), included => 1, USERPROFILE => C:\Users\dpope, NUMBER_OF_PROCESSORS => 4, TEMP => C:\Users\dpope\AppData\Local\Temp, WEBWORKS_HOME => C:\Program Files (x86)\BlackBerry\BB10 WebWorks SDK 2.2.0.15, BURN_AUTOPLAY => C:\Program Files (x86)\Roxio\Roxio Burn, PROCESSOR_ARCHITEW6432 => AMD64, BLACKBERRY_SETUP => true, CommonProgramFiles => C:\Program Files (x86)\Common Files, COMPUTERNAME => PI0004551, Damian’s home dir => C:\Users\dpope, ProgramW6432 => C:\Program Files, HOMEDRIVE => C:, SystemRoot => C:\windows, BLACKBERRY_WEBWORKS_SDK => C:\Program Files (x86)\BlackBerry\BB10 WebWorks SDK 2.2.0.15, asl.log => Destination=file, BLACKBERRY_DEVICE_PASSWORD => pitp, HAXELIB_RUN => 1, PUBLIC => C:\Users\Public, VBOX_INSTALL_PATH => C:\Program Files\Oracle\VirtualBox, KMP_DUPLICATE_LIB_OK => TRUE, native => , BLACKBERRY_NDK_ROOT => c:\bbndk, openfl-native => , BLACKBERRY_DEBUG_TOKEN => C:\bbndk-2.1.0\host\win32\x86\usr\bin\BHE-BB10-native.bar, PROCESSOR_IDENTIFIER => Intel64 Family 6 Model 42 Stepping 7, GenuineIntel, CommonProgramW6432 => C:\Program Files\Common Files, LIB => C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib, OS => Windows_NT, PATHEXT => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC, PCBRAND => p, PROCESSOR_REVISION => 2a07, APPDATA => C:\Users\dpope\AppData\Roaming, PTSMInstallPath_X86 => c:\Program Files (x86)\Hewlett-Packard\HP ProtectTools Security Manager, lime-legacy => 1, INCLUDE => C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include, PSModulePath => C:\windows\system32\WindowsPowerShell\v1.0\Modules, VS120COMNTOOLS => C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools, LOGONSERVER => \SATURN, ProgramData => C:\ProgramData, HAXE_SERVER_PORT => 0, QNX_HOST => %BASE_DIR_REPLACED%/host_10_3_1_12/win32/x86, OnlineServices => Online Services, SystemDrive => C:, TMP => C:\Users\dpope\AppData\Local\Temp, FP_NO_HOST_CHECK => NO, SESSIONNAME => Console, BLACKBERRY_DEVICE_IP => 169.254.0.1, openfl => , Path => C:\HaxeToolkit\neko;C:\HaxeToolkit\haxe;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared;C:\Program Files (x86)\Roxio\OEM\AudioCore;C:\Program Files (x86)\Intel\Services\IPT;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\Program Files\MATLAB\R2012a\bin;C:\Program Files\Google\Google Apps Sync;C:\Program Files\Google\Google Apps Migration;C:\Program Files\OpenVPN\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20131030\sdk\tools;C:\Program Files (x86)\Android\adt-bundle-windows-x86_64-20131030\sdk\platform-tools;C:\Program Files (x86)\Java;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files (x86)\Windows Live\Shared;C:\HaxeToolkit\neko;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files (x86)\BlackBerry\BB10 WebWorks SDK 2.2.0.15;C:\Program Files (x86)\BlackBerry\BB10 WebWorks SDK 2.2.0.15\cordova-blackberry\bin\dependencies\bb-tools\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE, ALLUSERSPROFILE => C:\ProgramData, USERDNSDOMAIN => PI.LOCAL, USERNAME => dpope, .ssh folder => C:\Users\dpope.ssh, CommonProgramFiles(x86) => C:\Program Files (x86)\Common Files, HAXEPATH => C:\HaxeToolkit\haxe, ComSpec => C:\windows\system32\cmd.exe, PROCESSOR_LEVEL => 6, EMC_AUTOPLAY => C:\Program Files (x86)\Common Files\Roxio Shared\OEM, windir => C:\windows, ProgramFiles => C:\Program Files (x86), HOMEPATH => \Users\dpope, PROMPT => $P$G}
Any help’s appreciated. Especially with upgrading to the BB10 NDK. Thanks!
Damian