今天刚玩Cocos2d-x 就遇到了一个大问题,所有环境都有,在Windows7下,执行官网下载源码根目录下的create-android-project.bat,如下:
Please enter your package path. For example: org.cocos2dx.example:com.cn.hello
Please enter your project name:HelloWord
“Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0”
“Other versions have not tested.”
Available Android targets:
id: 1 or “android-3”
Name: Android 1.5
Type: Platform
API level: 3
Revision: 4
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
ABIs : armeabi
id: 2 or “Google Inc.:Google APIs:3”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
ABIs : armeabi
id: 3 or “android-4”
Name: Android 1.6
Type: Platform
API level: 4
Revision: 3
Skins: HVGA, QVGA, WVGA800 (default), WVGA854
ABIs : armeabi
id: 4 or “Google Inc.:Google APIs:4”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 1.6 (API level 4)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, HVGA, WVGA800 (default), QVGA
ABIs : armeabi
id: 5 or “android-7”
Name: Android 2.1
Type: Platform
API level: 7
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
id: 6 or “Google Inc.:Google APIs:7”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 2.1 (API level 7)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA
ABIs : armeabi
id: 7 or “android-8”
Name: Android 2.2
Type: Platform
API level: 8
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
id: 8 or “Google Inc.:Google APIs:8”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 2.2 (API level 8)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA
ABIs : armeabi
id: 9 or “Samsung Electronics Co., Ltd.:GALAXY Tab Addon:8”
Name: GALAXY Tab Addon
Type: Add-On
Vendor: Samsung Electronics Co., Ltd.
Revision: 1
Based on Android 2.2 (API level 8)
Skins: WVGA854, WQVGA400, GALAXY Tab (default), HVGA, WQVGA432, WVGA800, QV
GA
ABIs : armeabi
id: 10 or “android-9”
Name: Android 2.3.1
Type: Platform
API level: 9
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
id: 11 or “Google Inc.:Google APIs:9”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 2.3.1 (API level 9)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA
ABIs : armeabi
id: 12 or “android-10”
Name: Android 2.3.3
Type: Platform
API level: 10
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
id: 13 or “Google Inc.:Google APIs:10”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 2.3.3 (API level 10)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA
ABIs : armeabi
id: 14 or “android-11”
Name: Android 3.0
Type: Platform
API level: 11
Revision: 2
Skins: WXGA (default)
ABIs : armeabi
id: 15 or “Google Inc.:Google APIs:11”
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 3.0 (API level 11)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WXGA (default)
ABIs : armeabi
id: 16 or “android-14”
Name: Android 4.0
Type: Platform
API level: 14
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800
ABIs : no ABIs.
id: 17 or “android-15”
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800
ABIs : armeabi-v7a
id: 18 or “android-16”
Name: Android 4.1.2
Type: Platform
API level: 16
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, W
XGA720, WXGA800, WXGA800-7in
ABIs : no ABIs.
Please input target id:7
Create android project
Create Android project inside proj.android
Created project directory: D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj
.android
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
srccomcnhello
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.androidsrccom
cnhelloHelloWord.java
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
res
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
bin
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
libs
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
resvalues
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
esval
uesstrings.xml
Created directory D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
reslayout
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.android
eslay
outmain.xml
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.androidAndroid
Manifest.xml
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.androiduild.x
ml
Added file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.androidproguar
d-project.txt
Resolved location of library project to: D:MobileCocos2dxcocos2d-2.0-x-2.0.4
cocos2dxplatformandroidjava
Updated project.properties
Updated local.properties
Updated file D:MobileCocos2dxcocos2d-2.0-x-2.0.4HelloWordproj.androidprogu
ard-project.txt
/cygdrive/d/Mobile/Cocos2dx/cocos2d-2.0-x-2.0.4/template/android/gamemk.sh: line
36: /cygdrive/d/Mobile/Cocos2dx/cocos2d-2.0-x-2.0.4/HelloWord/proj.android/jni/
Android.mk: Permission denied
sed:无法读取 /cygdrive/d/Mobile/Cocos2dx/cocos2d-2.0-x-2.0.4/HelloWord/proj.and
roid/src/org/cocos2dx/hellocpp/HelloCpp.java:Permission denied
rm: 无法删除"/cygdrive/d/Mobile/Cocos2dx/cocos2d-2.0-x-2.0.4/HelloWord/proj.andr
oid/src/org/cocos2dx/hellocpp": Permission denied
请按任意键继续. . .
高根目录是生成HelloWord不假,但是由于上边爆出Permission denied,所以有些文件没有生成,查看了下的确权限不够,感觉不像是源码出的问题,可能是win7权限问题,Permission denied明显是Cygwin爆出的,很费解create-android-project.bat里的配置:
set _CYGBIN=D:WorkToolsCygwinin
set _ANDROIDTOOLS=D:WorkToolseclipse_androidandroid-sdk-windows ools
set _NDKROOT=D:WorkToolseclipse_androidandroid-ndk-r8d
求高手指点