[HBuilder] 11:04:00.326 { Error: ENOENT: no such file or directory, open 'F:\code\hd\src\unpackage\dist\build\.tmp\app-plus\app.json'
[HBuilder] 11:04:00.326 at Object.fs.openSync (fs.js:646:18)
[HBuilder] 11:04:00.333 at Object.fs.readFileSync (fs.js:551:33)
[HBuilder] 11:04:00.334 at parseConfig (D:\HbuildX\HBuilderX\plugins\weapp-tools\lib\index.js:1:4187)
[HBuilder] 11:04:00.341 at index (D:\HbuildX\HBuilderX\plugins\weapp-tools\lib\index.js:1:13595)
[HBuilder] 11:04:00.342 at Promise (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-app-plus-plugin\index.js:17:11)
[HBuilder] 11:04:00.350 at new Promise (<anonymous>)
[HBuilder] 11:04:00.350 at compiler.hooks.done.tapPromise.compilation (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\@dcloudio\vue-cli-plugin-hbuilderx\packages\webpack-app-plus-plugin\index.js:12:14)
[HBuilder] 11:04:00.359 at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:17:17)
[HBuilder] 11:04:00.360 at AsyncSeriesHook.lazyCompileHook (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
[HBuilder] 11:04:00.369 at onCompiled (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:228:21)
[HBuilder] 11:04:00.370 at hooks.afterCompile.callAsync.err (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:556:14)
[HBuilder] 11:04:00.381 at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:6:1)
[HBuilder] 11:04:00.381 at AsyncSeriesHook.lazyCompileHook (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
[HBuilder] 11:04:00.393 at compilation.seal.err (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\webpack\lib\Compiler.js:553:30)
[HBuilder] 11:04:00.393 at AsyncSeriesHook.eval [as callAsync] (eval at create (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:6:1)
[HBuilder] 11:04:00.403 at AsyncSeriesHook.lazyCompileHook (D:\HbuildX\HBuilderX\plugins\uniapp-cli\node_modules\tapable\lib\Hook.js:154:20)
[HBuilder] 11:04:00.403 errno: -4058,
[HBuilder] 11:04:00.414 code: 'ENOENT',
[HBuilder] 11:04:00.415 syscall: 'open',
[HBuilder] 11:04:00.428 path: 'F:\\code\\hd\\src\\unpackage\\dist\\build\\.tmp\\app-plus\\app.json' }
[HBuilder] 11:04:00.428 [ERROR] 读取app.json失败...
[HBuilder] 11:04:00.440 ENOENT: no such file or directory, copyfile 'F:\code\hd\src\unpackage\dist\build\.tmp\app-plus\manifest.json' -> 'F:\code\hd\src\unpackage\dist\build\app-plus\manifest.json'
- 发布:2019-04-15 11:05
- 更新:2019-05-08 14:06
- 阅读:1667
7***@qq.com (作者)
11:21:09.816 {"__UUID__":"Invocation234774343","__TYPE__":"JSBObject","className":"android.support.v4.app.NotificationManagerCompat"} at App.vue:219
11:21:09.850 已开启通知权限 at App.vue:221
多了一个上方的提示,开发期间其他功能正常
7***@qq.com (作者)
找到原因了:是因为之前在组件中有类似如下代码
// #ifndef H5
A(){
// #ifdef APP-PLUS
let a=""
// #endif
// #ifdef MP-WEIXIN
let a=""
// #endif
}
// #endif
1.9 版本APP编译时,开发环境会提示变量重复。 正式包没有提示错误,估计是编译失败然后导致找不到APP.json
疑问:如上这种嵌套的编译语法是否是正确的,之前版本这样写是没问题的
Trust - 少说废话
变量重复是 lint 的插件校验的,应当这样写:
// #ifndef H5
A() {
let a = '';
// #ifdef APP-PLUS
a = ''
// #endif
// #ifdef MP-WEIXIN
a = ''
// #endif
}
// #endif
7***@qq.com (作者)
删除后,真机运行可以正常运行,多了我下方回复的一段提示
2019-04-15 11:25