Images and font not loading in release works on debug

Hi everyone,
This is my first game on cocos2dx,
I am using spritesheets for images. All images are loading in debug mode both in iOS and Android but they are not loading in release mode. here are screen shots of debug and release modes of game to make the situation clear.


Anyone facing this problem?

OK, i solved the problem by changing APP_OPTIM = debug in Release part of Application.mk. But i dont think this is a healty solution. If you have any other way to do it. I am open to new ideas.

OK, I made a new game and again same problem occurs and this time i am looking for a real solution rather than changing release to debug.
here is my application.mk

APP_STL := gnustl_static
APP_PLATFORM := android-9
APP_ABI := armeabi-v7a \
armeabi \
x86
APP_CPPFLAGS := -frtti \
-DCC_ENABLE_CHIPMUNK_INTEGRATION=0 \
-std=c++11 \
-fsigned-char
APP_LDFLAGS := -latomic
ifeq ($(NDK_DEBUG),1)
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
APP_OPTIM := debug
else
APP_CPPFLAGS += -DNDEBUG
APP_OPTIM := release
endif

i am using ndk 12b. what may be the problem. Why my bmfont and some images are lost in release mode.

For iOS also i have same problem and i am decreasing optimization level to -O1 from -OFast and problem removes. i am really stuck. Any help will be appreciated.

i am getting the android built with this script.
cocos compile --android-studio --target android-24 --mode release --ndk-toolchain arm-linux-androideabi-4.9 -p android --app-abi armeabi-v7a --src /Users/meth/Documents/CocosProjects/Solitaire/Solitaire/ -o /Users/meth/Desktop/ --ndk-mode release

and i am using cocos 3.12