System Environment win8.1
All test items are generated under D:\game\cocos
Cocos2d-x Engine Catalog for d:\game\cocos2d-x-2.2.5 and d:\game\cocos2d-x-3.2
Android NDK Directory D:\Android\android-ndk-r9d
v2.2.5
1. Build the project
Go to D:\game\cocos2d-x-2.2.5\tools\project-creator to execute the command line
Python create_project.py-project luagamev2-package org.test-language Lua
The project is generated in D:\game\cocos2d-x-2.2.5\projects, where LuaGameV2 is copied to D:\game\cocos
2. Build Android Project
2.1 Select D:\game\cocos\LuaGameV2\proj.android to import into eclipse. This project name is called Hellolua, and in eclipse you will see the Hellolua project, structured as follows
The arrows refer to the files that do not exist and need to be created by ourselves
2.2 There will be a missing cocos2dxactivity error first, here you can import the D:\game\cocos2d-x-2.2.5\cocos2dx\platform\android\java project to eclipse,
2.2.1 Here I renamed LOIBCOCOS2DX to Libcocos2dx-v2, I can add libcocos2dx-v2 directly to Hellolua's BuildPath project
2.2.2 will automatically generate the Libcocos2dx.jar package under the bin after import, of course, you can generate the jar package yourself, copy the package to LuaGameV2, and then join BuildPath
Either of these two options
2.3 Classes is a link resource from D:\game\cocos\LuaGameV2\Classes is primarily convenient for viewing CPP code in eclipse
2.4 Jni Generating so files
2.4.1 is compiled here using Android NDK r9d
The command line enters into the D:\game\cocos\LuaGameV2\proj.android and executes
D:\Android\android-ndk-r9d\ndk-build
There will be an error ndk_import_path unspecified what?
This is mostly D:\game\cocos\LuaGameV2\proj.android\jni\android.mk the module path is not configured to be added in Android.mk
$ (call import-add-path,d:/game/cocos2d-x-2.2.5)
$ (call import-add-path,d:/game/cocos2d-x-2.2.5/cocos2dx/platform/third_party/android/prebuilt)
Continue with D:\Android\android-ndk-r9d\ndk-build compilation generates OBJ and Libs package contents at this time
2.5 Introduce the resource file into assets to copy the D:\game\cocos\LuaGameV2\Resources file to assets
3. Test Android
3.1 Note Add the inside COCOSDX item or Libcocos2dx.jar to the orderandexport when the output
Test success
v3.2
Cond
Cocos2d-x v2 V3 build LUA project, Android test