cocos2dx3.2 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 estscpp-testsproj.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目录下
            .. oolscocos2d-consolepluginsproject_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环境变量是不是多了一个分句。若有。把分句去掉就可以。

原文地址:https://www.cnblogs.com/claireyuancy/p/6904171.html