標籤:cocos2d-x android平台
平台:win32 + android
cocos2d版本:3.2
搭建cocos2d-x android 常見問題:
問題1:
Android platform not specified, searching a default one...Can‘t find right android-platform for project :"F:\cocos2d-x-3.1.1\tests\cpp-tests\proj.android".The android-platform should be equal/larger than 20
解決方案:
如果你遇到這個問題,那麼就要在
下建立一個空的android-20檔案夾,這個問題坑了我很久!同時要查看命令是否是 –ap 20(雙-)。同時檢查\proj.android目錄下的project.properties是否是android-20
問題2:
cocos run -p android 報錯:檔案名稱、目錄名卷標文法不正確,
解決方案:
1)修改cocos2dx檔案夾下
..\tools\cocos2d-console\plugins\project_compile中的build_android.py
command = "%s clean -f %s -Dsdk.dir=%s" % (self._convert_path_to_cmd(ant_path), buildfile_path, self._convert_path_to_cmd(sdk_root))
改成
command = "%s clean %s -f %s" % (self._convert_path_to_cmd(ant_path), build_mode, buildfile_path)
2)然後用cmd,移動到專案檔夾下,運行 cocos run -p android
問題3:
編譯時間,提示找不到gcc對象鏈 (Couldn""t find the gcc toolchain)?
解決方案:
這個題目也煩了我好久!去搜檢下ndk的裝置路徑!NDK_ROOT是否正確!然後3.1版本須要的NDK是最新的版本,去安卓網站http://developer.android.com/tools/sdk/ndk/index.html#Installing下一個最新的版本r9d吧!
問題4:
The directory "android-19" can‘t be found in android SDK
解決方案:
你查看下ANDROID_SDK_ROOT環境變數是不是多了一個分句。若有,把分句去掉即可。
cocos2dx3.2 android平台搭建開發環境錯誤修正備忘錄