creator 2.0.9 构建小游戏失败

  • Creator 版本:2.0.9

  • 目标平台: Web

  • 详细报错信息,包含调用堆栈:
    SyntaxError: Unexpected token
    in JSON at position 1556
    at JSON.parse ()
    at Object.l [as readJson] (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/builtin/cocos-services/panel/utils/utils.js:1:649)
    at Object.readEnableService (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/builtin/cocos-services/panel/utils/serviceConfig.js:1:662)
    at Object.execInstallNativePlatformScript (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/builtin/cocos-services/panel/utils/ccServices.js:1:2875)
    at s (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/builtin/cocos-services/main.js:1:315)
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/editor-framework/lib/share/polyfills.js:1:286
    at Promise ()
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/editor-framework/lib/share/polyfills.js:1:260
    at /Applications/CocosCreator.app/Contents/Resources/app.asar/editor/lib/builder/index.js:1:858
    at
    at then.e (/Applications/CocosCreator.app/Contents/Resources/app.asar/editor/lib/builder/index.js:1:885)
    at
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

构建怎么失败,突然这样了。重装app创建空项目依然如此。

我今天也出现了,我的是 services.json 解析错误。我是把 services.json 删了就没问题了。你看看项目的 settings 文件夹下面有没有 services.json,如果有先备份到其他地方,然后删掉试试

遇到同样问题 删除也没用

那你的应该不是 services.json 错误,可能是其他的 json 文件出错了。可以新建一个工程,重新拷贝 assets 文件夹到新的工程里,然后再打开看看。

大神 按照你说的办法试了 不行啊

谢谢,我的问题也是这个。虽然解决了,但是我想不明白,怎么突然就触发了这个问题呢?

尚未解决中

你把settings文件夹下的json都删除也不行吗?

偶尔可以 偶尔不行 很大概率都不行

:disappointed_relieved: 以前从来没出现过这个问题,之前还好好的。突然就抽风了。不过,我好像操作过custom node,不知道有没有关系啊…

我今天也遇上了,一样的信息发版失败,求大神说明。

这部分的json有问题,如下:
,
“require_verify”: 1,
“service_price”: “The service according to usage billing,
billing rules ,
the fees incurred by the third party from your Cocos balances .”,
“packpage_version_desc”: “”,
“service_protocol”: "Game for the first time to open the service,
the Cocos after notification service for game on service and initialization parameters,
service party may according to need to get your Cocos account information,
such as account basic information,
game basic information,
account balance,
click on the confirm open button that is seen as you agree to the service to access your account information,
See < a href=‘http://auth.cocos.com/CocosServiceAgreement.html’>Cocos user service agreement and Cocos privacy policy "

是直接删除吗

红色波浪线处的字符串折行了,解析失败。

都行,把格式改对了就好了。

这个 service json 的作用是什么?每次编译这里都异常;

看起来是 service 一栏的配置,这个是后台下发的吗?
是引擎的 bug?

这个问题已经解决了
你们删掉service.json再重启编辑器就行。