Miss texture when running release version

I encounter a strange problem when I running release version of my game. some pictures in my UI are missing or worse, crashing the game.
I don’t know why because when I run the debug version everything is OK. The crash break point indicates some texture in cache was missing. Can someone tell me how to solve this bug? thank you so much for any reply.

help, please!

Are your texture files too large to run on the device you are testing on?

I tryed to create an enironment with least texture. But texture is still missing. I am trying to hard code my UI without using cocosstudio. hoping it will be ok…

I think you should turn the build action mode to “content” for your resource to copy when it build. When I use Visual Studio, sometime I’ve to change the texture’s properties (Right click to your resource file) like this: “Build Action: Content” and “Copy to Output Directory: Copy if newer”.

Sorry for not mention my coding environment. I am using XCode and cocos2d-x 3.0. And the texture is not missing everytime. Sometime is ok, sometime is not.

hi @zhujiawei6000 :smile:

Just one question.
Is it working in the simulator perfectly ?
and if you are running it in device is that problem remaining for every device or some device… ??

It works in simulator everytime. The problem exists in all the devices I have including iTouch5, iPhone6, iPad

Check if the name of the files you passed in. Devices are case-sensitives when it comes to file names compared to simulator.

sometimes the game would run perfectly on simulator.

The reason could be -

Say, you have dragged an image from your desktop to the Xcode.
So, a reference is made to the desktop to get the image by XCode, therefore when you run the app on the simulator the reference is there and thereby you are facing no problems in your game.

But, when you build and install the game in your device, that reference is not present because the sprite was present in your desktop and your tab or smartphone doesn’t have that window in it. :smile:

So, what you need to do -

  • cross check the above mentioned things.
  • delete any previously present reference.
  • place all your assets inside the resources folder and make those image reference to Xcode.

I think this would solve your issue, if it happened as I guess. :smile:

Happy Coding :smile: