天天看点

同步manifest.js失败,原因:com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true)...

场景:

今天我在使用 hbuildx打包app的时候莫名其妙的提示我不能打包,说是同步manifest.json失败

// 错误提示
同步manifest.json失败,失败原因:
com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) 
to accept malformed JSON at line 255 column 2 path $...
           

最后经过一番查证发现是 main.json 文件中的json数据有问题,虽然我并没用动过它。可能是更新 hbuild 导致的问题,

解决办法

就是修改 main.json 的内容

通过使用:在线校验json数据格式工具 校验main.json 的内容

继续阅读