Cocos Creator support for Android v4.0 (Ice cream Sandwich)

Hi, can someone tell me if it is possible to build games for Android v4.0.x (API Level 14, Ice cream Sandwich) or v4.1.x (API Level 16, Jellybean) or even v4.4.x (API Level 19, KitKat) with Cocos Creator v1.6.1.

I’ve made a simple game but unable to run the same on any v4.x Android versions. If I try to compile the same with any of the above mentioned API Levels, it gives me various errors.

Can someone help me run the game on these devices. There are still quite a large chunk of devices with these versions of Android and I’d prefer not to miss them.

Thanks,
Abhimanyu

@slackmoehrle : Can you please let me know if this is possible.

What are these mysterious “various” errors?

can you share some logcat or anything obvious ?

Hi @slackmoehrle and @piotrros,

Apologies for the vague description earlier. I noticed this issue is occurring only in my current project. I created another project, and I’m not facing any issue in the new one.

Below are the errors showing up in the log files during compilation, when I set the API Level to android-10. If I set it to android-25, I don’t get these issues.

Strangely these are very basic functions (atoi, atof and rand), which should not have been an issue in the first place.

Below is the error Log:
/Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCParticleSystem.cpp:597: error: undefined reference to 'rand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCTMXXMLParser.cpp:647: error: undefined reference to 'atof' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCTMXXMLParser.cpp:653: error: undefined reference to 'atof' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCTMXXMLParser.cpp:696: error: undefined reference to 'atof' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCTMXXMLParser.cpp:690: error: undefined reference to 'atof' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/base/CCConsole.cpp:1211: error: undefined reference to 'srand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/base/CCConsole.cpp:1212: error: undefined reference to 'rand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/base/CCConsole.cpp:1240: error: undefined reference to 'srand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/base/CCConsole.cpp:1241: error: undefined reference to 'rand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/base/ccRandom.h:117: error: undefined reference to 'rand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCActionTiledGrid.cpp:280: error: undefined reference to 'srand' /Users/abhimanyu/Documents/CocosCreatorProj/AdventureTales/build/jsb-default/frameworks/cocos2d-x/cocos/2d/CCActionTiledGrid.cpp:606: error: undefined reference to 'srand'

Use ndk r13b.

2 Likes

Thanks Piotrros. I was already using NDK r13b. It’s possible that the issue might have creeped in due to upgrading the project from CC 1.5.1 to CC 1.6.1.

Now that I’ve reimplemented the project from scratch, the issue seems to have been resolved.

I’m extremely thankful to you guys for promptly helping me out. :slight_smile:

Best Regards,
Abhimanyu