简体   繁体   English

cocos creator 无法为安卓平台构建

[英]cocos creator can not build for android platform

The information I got as follows.我得到的信息如下。

Traceback (most recent call last):
    File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\bin\cocos.py", line 983, in 
      run_plugin(command, argv, plugins)
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\bin\cocos.py", line 875, in run_plugin
    plugin.run(argv, dependencies_objects)
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py", line 258, in run
    self.parse_args(argv)
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py", line 104, in parse_args
    description=self.__class__.brief_description())
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\plugins\plugin_new\project_new.py", line 43, in brief_description
    return MultiLanguage.get_string('NEW_BRIEF')
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\bin\MultiLanguage.py", line 52, in get_string
    fmt = cls.get_instance().get_current_string(key)
  File "C:\CocosCreator\resources\cocos2d-x\tools\cocos2d-console\bin\MultiLanguage.py", line 158, in get_current_string
    ret = ret.encode(self.encoding)
  File "C:\CocosCreator\resources\utils\Python27\lib\encodings\cp1252.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-8: character maps to <undefined>

any one knows why this happened?有谁知道为什么会这样?

I do not know python, but the problem seems solved afterI made the modification to the line 158 of MultiLanguage.py(in the get_current_string method):我不知道python,但在我对MultiLanguage.py的第158行(在get_current_string方法中)进行修改后问题似乎解决了:

ret = ret.encode(self.encoding)

to the following line:到以下行:

        ret = ret.encode("utf8") #self.encoding

Hope this helps people who encounter the same problem.希望这可以帮助遇到同样问题的人。

Take a look at the versions of NDK and SDK, NDK.看看NDK和SDK的版本,NDK。 The recommended version is R17 - R19推荐版本为 R17 - R19

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 可以根据环境调用MSBuild或Xbuild的跨平台构建脚本吗? - Cross platform build script that can call MSBuild or Xbuild depending on environment? python可以构建android应用程序吗? - Can python build android apps? 无法为Android构建jxcore - Can't build jxcore for android 我无法为 android 构建构建器 - I Can't build buildozer for android 无法使用 buildozer 在 Mac 上为 android 构建 - Can't build for android on Mac with buildozer 如何在Qt Creator中锚定小部件? - How can I anchor widgets in Qt Creator? [cocos2d-x]当我尝试在Windows 10中运行&#39;python android-build.py -p 19 cpp-tests&#39;时出现错误 - [cocos2d-x]I have an error when I try to run 'python android-build.py -p 19 cpp-tests' in Windows 10 PySide2,Qt Creator 运行问题:即使找到了,也无法在“”中加载 Qt 平台插件“cocoa” - PySide2, Qt Creator run issue: Could not load the Qt platform plugin "cocoa" in "" even though it was found Google Cloud Platform:有没有办法使用服务帐户密钥获取有关服务帐户创建者的信息 - Google Cloud Platform: Is there a way to get information about the creator of a service account, using the service account key Cocos2D-JS - 编译并运行'Clean'构建? - Cocos2D-JS — Compile and Run a 'Clean' build?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM