cocos2dx3.2 android平台搭建開發環境錯誤修正備忘錄

來源:互聯網
上載者:User

標籤: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平台搭建開發環境錯誤修正備忘錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.