命令行打包出错:Update xcode please.
解决方法: 打开引擎下目录文件 …/Cocos2d-x/cocos2d-x-3.10/tools/cocos2d-console/plugins/plugin_compile/project_compile.py
找到以下代码:
def check_ios_mac_build_depends(self):
version = cocos.get_xcode_version()
if version <= '5':
message = MultiLanguage.get_string('COMPILE_ERROR_UPDATE_XCODE')
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_TOOLS_NOT_FOUND)
修改为:
def check_ios_mac_build_depends(self):
version = cocos.get_xcode_version()
# if version <= '5':
# message = MultiLanguage.get_string('COMPILE_ERROR_UPDATE_XCODE')
# raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_TOOLS_NOT_FOUND)
然后由遇到:system(command.c_str()) 报错,解决如下:
bool FileUtils::removeDirectory(const std::string& path)
{
#if !defined(CC_TARGET_OS_TVOS)
// std::string command = "rm -r ";
// // Path may include space.
// command += "\"" + path + "\"";
// if (system(command.c_str()) >= 0)
// return true;
// else
// return false;
bool ret = true;
DIR *pDir;
dirent *ent;
char childpath[512] = {0};
pDir = opendir(path.c_str());
if (!pDir)
return ret;
while ((ent = readdir(pDir)) != NULL)
{
if (ent->d_type & DT_DIR)
{
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
continue;
sprintf(childpath, "%s/%s", path.c_str(), ent->d_name);
if (!FileUtils::removeDirectory(childpath)){
break;
}
}
else
{
std::string str_file = path + "/" + ent->d_name;
remove(str_file.c_str());
}
}
closedir(pDir);
remove(path.c_str());
return ret;
#else
return false;
#endif
}
重新打包没问题了