Problem running sample project on BB10 on Mac OS X

Hello everyone,

I am having difficulties in running up a sample project on BB10 simulator using the native SDK on Mac OS X Lion. I can run my game for the iOS & Android platform comfortably but I am facing problems for BB10.
I followed all the steps mentioned in this tutorial.
http://devblog.blackberry.com/2013/01/cocos2d-x-on-blackberry-10/
The project is getting compiled without any error but when tried to Run-as BlackBerry C++ Application, I get an error saying Launch failed no binaries. (attached screenshot - BB10_error.png)
Can anyone tell me what should be done to resolve this and how to get cocos2d-x projects running on BB10?
I am using cocos2d-2.1beta3-x-2.1.0 version.


BB10_error.png (15.1 KB)

paste your classes and resources in test.cpp project and then compile it will work properly or else using terminal create blackberry project and run it .

Hi Narendra,

I tried pasting the classes and resources in the Test.cpp project but still no luck, getting an error as CCApplication.h not found. Can you tell me how to create a new blackberry project via terminal?

if you select all required things cocos2d-x ,box2d ,chipmunk and other you used at the time of importing the project then it will not give error.

I am also facing the same problem, can anyone from BB team guide us very clearly? What i think is there are some bugs still exists in QNX or BB10.

“No binaries” basically means it didn’t compile/link properly. Check your log files for any build errors or warnings.

I’ve also found that you sometimes need to randomly clean/restart the editor occasionally, because it gets confused. Pretty annoying.

Anyway, I managed to submit six BB10 games for the port-a-thon last week, so I can confirm that the library does indeed work as expected once you’ve got it set up.

Ben

Hi Ben,

I keep on getting the following warning - Attribute ‘id’ is deprecated, please remove. bar-descriptor.xml /MyProject line 67 BlackBerry App Manifest Problem.
What should be replaced with ‘id’ ?
Also, I get the following error - fatal error: …/Classes/AppDelegate.h: No such file or directory main.cpp /MyProject line 2 C/C++ Problem

  • even though it consists of AppDelegate.h and other classes which are only visible in Finder.
    Also, cleaning & restarting didn’t helped.

Pinakin Salvi wrote:

I keep on getting the following warning - Attribute ‘id’ is deprecated, please remove. bar-descriptor.xml /MyProject line 67 BlackBerry App Manifest Problem.
What should be replaced with ‘id’ ?

Actually I just removed the id attribute - it didn’t appear to be required and I couldn’t find anything about it in the BB docs. I was able to compile either way though, so I don’t think this is your issue.

Pinakin Salvi wrote:

Also, I get the following error - fatal error: …/Classes/AppDelegate.h: No such file or directory main.cpp /MyProject line 2 C/C++ Problem
>

  • even though it consists of AppDelegate.h and other classes which are only visible in Finder.
    Also, cleaning & restarting didn’t helped.

That sounds like your main problem. Make sure your include folders are set properly, and remember that you are referencing relative to the Device-Debug/Device-Release/Simulator folders rather than your Blackberry project folder. So you might need an extra “…/” in your files. I spent ages going through my .cproject and .project files to get this right as I’ve moved all my project files out of the cocos2d-x folder. If you’ve done the same just make sure your references are relative to the Device-Debug/Device-Release/Simulator folders and you’ll be in business.

Hope that helps!

Ben

Oh, and make sure you add Freetype to your linker settings. Go to your project properties~~>C/C++ General~~>Paths and Symbols->Libraries tab, and add “freetype” to the list.

Ben

Ben, can you provide detailed step by step tutorial or the steps you executed to get it work for you?

Pinakin Salvi wrote:

Ben, can you provide detailed step by step tutorial or the steps you executed to get it work for you?

Ah well my steps will be different to your steps I imagine, as I have created a multi-platform project layout (i.e. sharing code and resources between multiple platforms). Also I was hacking on it for ages during the port-a-thon and wasn’t exactly scientific with my methods. Sorry!

I, more-or-less, did something like this:

  1. Copy the TestCpp example project into my project folder (samples/TestCpp/proj.blackberry/).
  2. Open up .cproject, .project and bar-descriptor.xml in a text editor. If you’re using Mac/Linux then you’ll need to make sure hidden files are visible for the first two to show up.
  3. In .cproject I had to replace all the folder references with my own versions (I did a search replace on the “…/…/…/” parts). You can also do this inside Momentics project settings if you find it easier.
  4. In .project, remove the project references in don’t need (under ). I removed Box2d and chipmunk as I don’t use them in my game. Then make sure your Classes and Resources folder links are pointing to the right place. Again you can do this inside Momentics if you find it easier.
  5. In bar-descriptor.xml most of this should be fairly self-explanatory. You’ll need to set up your folder references here again if you’re in a non-standard project location (like I was).

Hope that helps!

Ben

SOLVED….!

Finally got my code running for BB10 as well as BB Playbook. Here are the steps to create a new project on MAC:
I’m using the cocos2d-2.0-x-2.0.4 version.

To create a new project:

  1. Open terminal.
  2. Change the directory to your extracted cocos2d-2.0-x-2.0.4 library which you downloaded.
  3. Run the file create-blackberry-project.sh
  4. You’ll be prompted to input your desired project name. (Here, we’ll refer to it as MyDemoProject).
  5. Congratulations, you have successfully created your project.

Then, follow these steps:

  1. Create a workspace wherever you want.
  2. Launch the Momentics IDE.
  3. Select File~~>Import~~>General~~>Existing projects from Workspace. Please UNCHECK Copy to workspace.
  4. Import the extracted cocos2d-2.0-x-2.0.4 library which you downloaded.
  5. Select all the files with proj.blackberry as extension.
  6. You’ll see MyDemoProject imported along with some other projects.
  7. Build your project. You’ll see a lot of warnings along with few errors.
  8. On the recent cocos2dx build cocos2d-2.0-x-2.0.4 you may see this:
    undefined reference symbol ‘FT_New_Face’ undefined error.
    This is because the freetype library is missing in the project dependencies — let’s see how to fix that:
    a. Right click the erroneous project
    b. Select Properties~~> C/C*+ General ~~> Paths and Symbols
    c. Select from the configuration dropdown menu
    d. Choose Libraries tab and Add freetype library
    e. Build again.
  9. Now, you’ll be left with the CocosDenshion not found error.
  10. To resolve this, in project explorer, you’ll find a folder named as Device-Debug and Simulator. .
  11. Add the file, libCocosDenshion.so inside the folder Classes located in Device-Debug and the same will follow for the Simulator .
  12. Add the file, libgrskia.so inside the folder Classes located in Device-Debug and the same will follow for the Simulator .
  13. The path for the above two files should be set inside bar-descriptor.xml file as “Device-Debug/Classes/libCocosDenshion.so”
  14. Also, you’ll see warnings such as ‘id’ is deprecated and ‘action’ is deprecated use ‘permission’ instead.
  15. For this warning, inside bar-descriptor.xml, remove the id parameter and just keep the ‘name’ parameter.
  16. After launching the simulator in VMWare Fusion, configure your BB10 or BBPlaybook Simulator from Momentics~~>Preferences~~>Blackberry~~>Set up Deployment Wizard .
  17. Build the project and run as Blackberry C/C*+ Application.

Enjoy.

Thanks Aniket Kote, Pavan Patil. We did it.

Regards,
Pinakin

Excellent, I’m glad you got it working Pinakin Salvi!

Ben

Thanks Ben.

HI… how do I exactly set the assets path in bar-description for cocosDenshion?
The path for the above two files should be set inside bar-descriptor.xml file as “Device-Debug/Classes/libCocosDenshion.so” (To edit bar-descriptor.xml, select the source tab)

ok… now I am getting a libpng error…
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

I even loaded a jpg instead of png still no progress…