uni-app 原生APP打包出错

uni-app 原生APP打包出错

产品分类:

uniapp/App

PC开发环境操作系统:

Windows

PC开发环境操作系统版本号:

win10

HBuilderX类型:

正式

HBuilderX版本号:

3.2.9

手机系统:

全部

手机厂商:

华为

页面类型:

vue

打包方式:

云端

项目创建方式:

HBuilderX

测试过的手机:

暂无

操作步骤:

  • 创建uni-app项目,选择VUE3版本。项目开发好之后,选择“原生APP-云打包”

预期结果:

  • 打包成功

实际结果:

  • 控制台报错,关于CSS方面。怀疑是vite的问题

bug描述:

只要给APP打包就出现错误。如果是手机调试和运行在浏览器就没有问题;下面报错信息:

[HBuilder] 18:43:55.386 warnings when minifying css:
[HBuilder] 18:43:55.386  > stdin:10:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.391     10 │ @charset "UTF-8";
[HBuilder] 18:43:55.391        ╵ ~~~~
[HBuilder] 18:43:55.396    stdin:4:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.396      4 │ *{
[HBuilder] 18:43:55.401        ╵ ^
[HBuilder] 18:43:55.402 warnings when minifying css:
[HBuilder] 18:43:55.407  > stdin:36:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.407     36 │ @charset "UTF-8";
[HBuilder] 18:43:55.413        ╵ ~~~~
[HBuilder] 18:43:55.413    stdin:31:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.419     31 │ .uni-icons[data-v-afb01c98] {
[HBuilder] 18:43:55.419        ╵ ^
[HBuilder] 18:43:55.427 warnings when minifying css:
[HBuilder] 18:43:55.427  > stdin:36:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.434     36 │ @charset "UTF-8";
[HBuilder] 18:43:55.434        ╵ ~~~~
[HBuilder] 18:43:55.439    stdin:31:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.439     31 │ .uni-icons[data-v-afb01c98] {
[HBuilder] 18:43:55.445        ╵ ^
[HBuilder] 18:43:55.450  (x2)
[HBuilder] 18:43:55.451 warnings when minifying css:
[HBuilder] 18:43:55.457  > stdin:36:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.457     36 │ @charset "UTF-8";
[HBuilder] 18:43:55.462        ╵ ~~~~
[HBuilder] 18:43:55.463    stdin:31:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.468     31 │ .uni-icons[data-v-afb01c98] {
[HBuilder] 18:43:55.468        ╵ ^
[HBuilder] 18:43:55.474  (x3)
[HBuilder] 18:43:55.474 warnings when minifying css:
[HBuilder] 18:43:55.480  > stdin:36:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.480     36 │ @charset "UTF-8";
[HBuilder] 18:43:55.486        ╵ ~~~~
[HBuilder] 18:43:55.486    stdin:31:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.492     31 │ .uni-icons[data-v-afb01c98] {
[HBuilder] 18:43:55.498        ╵ ^
[HBuilder] 18:43:55.503  (x4)
[HBuilder] 18:43:55.508 warnings when minifying css:
[HBuilder] 18:43:55.513  > stdin:36:0: warning: "@charset" must be the first rule in the file
[HBuilder] 18:43:55.519     36 │ @charset "UTF-8";
[HBuilder] 18:43:55.519        ╵ ~~~~
[HBuilder] 18:43:55.524    stdin:31:0: note: This rule cannot come before a "@charset" rule
[HBuilder] 18:43:55.524     31 │ .uni-icons[data-v-afb01c98] {
[HBuilder] 18:43:55.530        ╵ ^
[HBuilder] 18:43:55.530  (x5)

Image


更多关于uni-app 原生APP打包出错的实战教程也可以访问 https://www.itying.com/category-93-b0.html

2 回复

同样是这种问题,现在有解决方案吗

更多关于uni-app 原生APP打包出错的实战教程也可以访问 https://www.itying.com/category-93-b0.html


组件中css样式优化下

回到顶部