One strange error occurs to CMake build for the Github latest version (May 13th, 2018), when I build and run on my MAC, no errors occur, But when testing on other 2 MAC, build success, and then crash when using Resource files, I have on idea about this issue.
How to reproduce
// checkout v3 branch latest code
cd cocos2d-x
mkdir mac-build && cd mac-build
cmake .. -GXcode // generate Xcode project by cmake
open Cocos2d-x.xcodeproj
// build and run cpp-tests project using Xcode
// click any test item, for example 28:Node:Label - New API
// see if crash
Need help
I don’t know why it didn’t crash on my MAC, but crash on other 2. When I research the difference of Resource folder in the app package, I can’t find any difference. Anyone can help me to do a test, and try to find the reason?
ok, I can help with whatever you need.
28:Node:Label - New API. - works for me. But I have crash in AutoTest
// checkout v3 branch latest code
cd cocos2d-x
mkdir mac-build && cd mac-build
cmake .. -GXcode // generate Xcode project by cmake
open Cocos2d-x.xcodeproj
// build and run cpp-tests project using Xcode
//Start AutoTest
wait few minutes ....
Crash here:
LabelIssue16717::LabelIssue16717()
{
auto bg = Sprite::create("cocosui/Hello.png");
bg->setPosition(VisibleRect::center());
addChild(bg);
No "cocosui/Hello.png
Not crash on LabelIssue16717 for me, search the cocosui/Hello.png
, it located at Resources/ccs-res/cocosui/Hello.png
, and then I found
searchPaths.push_back("ccs-res"); // at AppDelegate::applicationDidFinishLaunching
This is the fix, cmake use SQLite in wrong way, lead to load PNG failed in some MAC.