Preparatory work
You just have to follow the last article of the Cocos2d-x 3.0 final environment is ready to build
1. Edit Proj.android\jni\android.mk, change content such as the following
Local_path: = $ (call My-dir) include $ (clear_vars) Local_module: = Cocos2dcpp_sharedlocal_module_filename: = libcocos2dcpp# functions that Traverse folders and subfolders define walk$ (wildcard $ (1)) $ (foreach E, $ (wildcard $ (1)/*), $ (call Walk, $ (e))) endef# traversal Clas Ses folder Allfiles = $ (call walk, $ (local_path)/. /.. /classes) File_list: = hellocpp/main.cpp# Extracts all the. cpp files from all files File_list + = $ (filter%.cpp, $ (allfiles)) Local_src_files: = $ (file_list:$ (Local_path)/%=%) Local_c_includes: = $ (local_path)/... /.. /classeslocal_whole_static_libraries: = cocos2dx_staticlocal_whole_static_libraries + = Cocosdenshion_staticLOCAL_ Whole_static_libraries + = box2d_static #假设使用的是chipmunk引擎须要加上 chipmunk_staticlocal_whole_static_libraries + = Cocos_ Extension_static #因为使用了扩展, so add local_whole_static_libraries + = cocosbuilder_staticlocal_whole_static_libraries + = Cocos_network_staticlocal_whole_static_libraries + = Cocostudio_staticinclude $ (build_shared_library) $ (call IMPORT-MODULE,2D) $ (call Import-module,audio/android) $ (call import-module,box2d) #同上 $ (callImport-module,extensions) #同上 $ (call Import-module,editor-support/cocosbuilder) $ (Call Import-module,editor-support /cocostudio) $ (call import-module,network)
If you use the #include "cocos-ext.h" header file, change the location in the introduction to
#if (Cc_target_platform = = cc_platform_android) #include "extensions/cocos-ext.h" #else include "Cocos-ext.h" #endif
Android Landscape vertical screen changes such as the following, a vertical screen
android:screenorientation= "Portrait"
2.CMD to Proj.android folder, type Python build_native.py, start compiling,environment to build a look, and update the SDK manager inside the Android platform 4.4.2 (this is what I chose, you choose which on demand)
3. After compiling, open Eclispe, select File, import, import your project folder under Cocos2d\cocos\2d\platform\android\java, import, this is the reference LIBCOCOS2DX project, his property is the library, Do not move after importing
4. Select File--Import, this time is the import of your project Proj.android projects, project import will be actively connected to the LIBCOCOS2DX library, after import directly, OK
Cocos2d-x 3.0 Final Transplant Android