读取位图时出错 - java.io.FileNotFoundException: ../files/app/assets/icon.png: 打开失败:ENOENT(没有这样的文件或目录)

Error in reading bitmap - java.io.FileNotFoundException: ../files/app/assets/icon.png: open failed: ENOENT (No such file or directory)

升级到 nativescript 8 后出现此错误。

我的项目结构是:

src
- app
- assets
- fonts

我的 Webpack 文件包含:

const copyTargets = [{ from: { glob: 'assets/', dot: false } }, { from: { glob: 'fonts/', dot: false } }, ...copyReplacements] ; new CopyWebpackPlugin([...copyTargets, { from: { glob: '/*.jpg', dot: false } }, { from: { glob: '/*.png' , 点: false } }], copyIgnore),

有什么想法吗?

它在你的 webpack.config.ts

const copyTargets = [
   { from: { glob: 'assets/', dots: false } },  // note that dots not dot. 
   { from: { glob: 'fonts/', dot: false } } // note that dots not dot. 
];

new CopyWebpackPlugin = ([...copyTargets], copyIgnore); // no need to re add your globs again.

如果你解决了这个问题,请告诉我。