Question

I just downloaded the Cocos2d-x SDK and tried to compile the hello world example with the following result:

<code>The Selected NDK toolchain version was 4.8 !
Android NDK: WARNING: Ignoring unknown import directory: /home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android/../cocos2d    
Android NDK: WARNING: Ignoring unknown import directory: /home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android/../cocos2d/external    
Android NDK: WARNING: Ignoring unknown import directory: /home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android/../cocos2d/cocos    
Android NDK: jni/Android.mk: Cannot find module with tag '2d' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
Android NDK: The following directories were searched:    
Android NDK:         
make: Entering directory `/home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android'
jni/Android.mk:22: *** Android NDK: Aborting.    .  Stop.
make: Leaving directory `/home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android'
Traceback (most recent call last):
  File "./build_native.py", line 166, in <module>
    build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
  File "./build_native.py", line 153, in build
    do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
  File "./build_native.py", line 89, in do_build
    raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ /home/sytrox/Downloads/cocos2d-x/template/multi-platform-cpp/proj.android ] fails!</code>

No correct solution

OTHER TIPS

Which cocos2d-x version are you using? Seems like you didn't define your env variables correctly. Please have a look at this tutorial and make sure you define the following variables:

  • COCOS2DX_ROOT : should point to the root directory of cocos2d-x
  • ANDROID_SDK_ROOT : Should point to the root directory of the Android SDK
  • NDK_ROOT : Should point the to root directory of the Android NDK
  • NDK_TOOLCHAIN_VERSION : Which Android NDK toolchain should be used

See the problem is that the system is not able to compile the cocos.py. So, if you open cocos.py from the bin directory where you have unzipped the file it runs smoothly. The thing is Python3.x is not able to compile the Phython2.x code. So we must change the path in environment variable so the system doesn't a python2 file with the help of python3 compiler. Thanks

Summary 1.Go to Control Panel, then type path or environment in search bar 2.open Evnvironment variables 3.Just delete any C:\Python34 or anything starts with python3.x and add C:\Python27 path where you have installed.

Video link: https://youtu.be/T8zk3sv0cL0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top