809543488@qq.com
809543488@qq.com
  • 发布:2019-03-13 10:13
  • 更新:2019-04-23 18:37
  • 阅读:5006

【已解决】HBuilderX uni-app云打包失败,提示找不到app.json,读取app.json失败

分类:uni-app

uni-app用HBuilderX原生App-云打包,android 和 ios均打包失败

控制台输出信息:
项目 ... 开始编译...
Error: ENOENT: no such file or directory, open '...\unpackage\dist\build.tmp\app-plus\app.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at parseConfig (D:\RunSoft\HBuilderX\plugins\weapp-tools\lib\index.js:1:4187)
at index (D:\RunSoft\HBuilderX\plugins\weapp-tools\lib\index.js:1:12473)
at Promise (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-app-plus-plugin\index.js:17:11)
at new Promise (<anonymous>)
at compiler.hooks.done.tapPromise.compilation (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-app-plus-plugin\index.js:12:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:17:17)
at AsyncSeriesHook.lazyCompileHook (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
at onCompiled (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:228:21)
at hooks.afterCompile.callAsync.err (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:556:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
at compilation.seal.err (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:553:30)
at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (D:\RunSoft\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: '...\unpackage\dist\build\.tmp\app-plus\app.json' }
[ERROR] 读取app.json失败...
ENOENT: no such file or directory, copyfile '...\unpackage\dist\build.tmp\app-plus\manifest.json' -> '...\unpackage\dist\build\app-plus\manifest.json'

求解!!!

2019-03-13 10:13 负责人:无 分享
已邀请:
809543488@qq.com

809543488@qq.com (作者)

本人已解决,最后发现是vue语法错误,多层循环时,key定义名称重复了

<view v-for="(item,**key**) in items" :key="**key**">  
  <view v-for="(detl,**key**) in item.detl" :key="**key**"></view>  
</view>

key的定义重复了,所以如果再遇到这种问题,应该如下检查
1.检查vue或者js语法是否正确
2.检查js、vue组件、css引用的路径是否正确
3.新建一个项目,将代码一个页面一个页面的拷贝过来进行“生成本地打包App资源”看是否报错
我就是这样进行排错的,1、2均会报上诉错误,现在已不存在该问题了

  • 1144106538@qq.com

    请问重复了,应该怎么解决了,:key又不能不加

    2019-04-09 09:24

Mercury

Mercury

遇到了同样的问题,希望能尽快有人解答

Mercury

Mercury

我也解决了,情况和楼上差不多

784957430@qq.com

784957430@qq.com

        • ```javascript
          ```javascript  
          > > > > > > > > > > > > > ******************
1842327688@qq.com

1842327688@qq.com

原因是用了v-for嵌套,把v-for嵌套写在组件,再引入就好了。

要回复问题请先登录注册