Please use cocos console instead

HI ! ^^

when I type ‘python ./build_native.py’ in the terminal (for android version),
that message is shown…

But…

I already use cocos console for create project. (with new command)
That is why I have ‘build_native.py’ file.

Why they say ‘Please use cocos console instead …’ ???

That means you should use cocos console for deploy too.
You can Create, Compile, Run & Deploy project through cocos console

Learn cocos console here

eg. If you are in project directory

cocos deploy -p android -m debug

It will create apk for you in bin folder.

thanks so much!!!
(but, then, why build_native.py is exist ? we can just use cocos console.)

build_native.py still exists because of backward compatibility.

1 Like

We have a free tutorial series on using the Cocos Console

http://bit.ly/1M4ajJp

1 Like

now I see… thank you

1 Like

Thanks^^…

1 Like

@SonarSystems I know you need users on your page. And I know you need likes and clicks on your tutorial-videos. But it is really a extremely bad behaviour to start “stealing” users from one page ot another.

3 Likes

I agree that this is just downright dis-respectful.

We have others on these forums with Cocos2d-x related products and they don’t redirect questions to their own support sites. Especially since what the user is asking about is a Cocos2d-x tool, not a Sonar tool.

Please refrain from doing this again. I have had to ask you to refrain from hijacking threads, posting meme’s and now trying to re-direct traffic of our users to your own support forums. I am getting rather frustrated with having to ask you to ask professional.

1 Like

Sorry I meant in regards to our tutorials that we linked, should have made it clearer.

And me, i never get it built:

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.exe: Entering directory C:/CocosProjects/Test1/proj.android' jni/Android.mk:25: *** Android NDK: Aborting. . Stop. make.exe: Leaving directoryC:/CocosProjects/Test1/proj.android’
Ndk build failed!
Traceback (most recent call last):
File “C:\CocosProjects\Test1\proj.android\build_native.py”, line 43, in
build(opts.build_mode)
File “C:\CocosProjects\Test1\proj.android\build_native.py”, line 28, in build
raise Exception(“Build dynamic library for project [ " + app_android_root +
" ] fails!”)
Exception: Build dynamic library for project [ C:\CocosProjects\Test1\proj.andro
id…/ ] fails!

Anyone can identify why this happens? I’m about to give up developing using Cocos…

1 Like

What command did you run?

build_native.py or cocos run … same thing happens.

What NDK version are you using?

android-ndk-r9d

What version of Cocos and what version of everything really?

cocos2d-x-3.6
apache-ant-1.9.4
windows 8.1 etc… ask me if you want to learn anything specific.

It seems you have some typo, non printable chars, spaces or whatever is parsed incorrectly in your file.
Please provide your Android.mk file.

Here is the content of my .mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp
…/…/Classes/AppDelegate.cpp
…/…/Classes/MainMenuScene.cpp
…/…/Classes/GameScene.cpp
…/…/Classes/PauseScene.cpp
…/…/Classes/GameOverScene.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)

Change

$(call import-module,2d)

to

$(call import-module,.)

Where did you get that 2d from? There is no module called 2d(an Android.mk file under that tag/path).
The line means the following:

$(call import-module,<tag>)
This will look for <tag>/Android.mk under any of the directories listed in your NDK_MODULE_PATH.

Where are your call import-add-path entries? Make sure you import your paths, if you are not using NDK_MODULE_PATH !