Search code examples
c++xcodecocos2d-x

Cocos2dx Update and Thread 1: EXC_BAD_ACCESS


After updating Cocos2dx and Xcode I started receiving the error: Thread1:EXC_BAD_ACCESS (code=1, address=0x0). It happens when I set the position but I think it has to do with the png image:

auto backgroundSprite=Sprite::create("thing.png");
backgroundSprite->setPosition(Vec2(visibleSize.width /2 +origin.x,visibleSize.height / 2 + origin.y));

I have tried to add this code and image to a different project and it works fine. I have also tried to switch the image file to something else but it didn't work.


Solution

  • Go to build settings and set: Remove Text Metadata From PNG Files = No