cocos run -p android 報錯:檔案名稱、目錄名卷標文法不正確

來源:互聯網
上載者:User

標籤:

我的項目是cocos2d-x-3.7.1的項目,用命令列(cocos run -p android)打包的時候報錯:

running: ‘"D:\develop\adt-bundle-windows-x86-20140321\apache-ant-1.9.3\bin\ant"
clean debug -f D:\deveop\Test\proj.android\build.xml -Dsdk.dir="D:\develop\adt-b
undle-windows-x86-20140321\sdk"‘

 

解決辦法:

進入cocos2d-x-3.7.1\tools\cocos2d-console\plugins\project_compile目錄。找到build_android.py檔案,用編輯工具開啟,

找到以下代碼位置(在這個版本中的位置是439行):

command = "%s clean %s -f %s -Dsdk.dir=%s" % (cocos.CMDRunner.convert_path_to_cmd(ant_path),                                                      build_mode, buildfile_path,                                                      cocos.CMDRunner.convert_path_to_cmd(self.sdk_root))

  修改成:

command = "%s clean %s -f %s -Dsdk.dir=%s" % (cocos.CMDRunner.convert_path_to_cmd(ant_path),                                                      build_mode, buildfile_path,    self.sdk_root)

  其實也就是把self.sdk_root外面的封裝(暫且這麼叫吧)去掉.

再次編譯就可以了!

 

如果想指定編譯的android版本:

cocos run -p android --ap android-10

(ap前面是2個-,切記)


 

cocos run -p 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.