【问题标题】:Error only in production: Manifest does not contain a suitable icon仅在生产中出现错误:清单不包含合适的图标
【发布时间】:2021-08-12 20:19:03
【问题描述】:

我正在制作 PWA,但遇到了一些问题。当应用程序处于开发模式时,我没有收到 PWA 的错误,但是当我将其推送到生产环境时,我得到:

Web 应用清单或 Service Worker 不满足可安装性要求

清单不包含合适的图标 - 需要至少 144 像素的 PNG、SVG 或 WebP 格式,必须设置 sizes 属性,并且如果设置了 purpose 属性,则必须包含“any”或“maskable”。

我不明白为什么,因为这是我的 manifest.json

{
  "short_name": "Ionic App",
  "name": "My Ionic App",
  "icons": [
    {
      "src": "assets/icon/favicon.png",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon",
      "purpose": "any"
    },
    {
      "src": "assets/icon/icon.png",
      "type": "image/png",
      "sizes": "512x512",
      "purpose": "maskable"
    }
  ],
  "start_url": ".",
  "display": "standalone",
  "theme_color": "#ffffff",
  "background_color": "#ffffff"
}

任何帮助将不胜感激

【问题讨论】:

    标签: reactjs ionic-framework progressive-web-apps manifest.json


    【解决方案1】:

    这是我当前收到的错误消息。

    据此,如果设置的目的属性应该包括“可屏蔽”。

    【讨论】:

    • 对于它的价值,我的错误原来是由于图标的“类型”属性中的拼写错误,使用破折号而不是斜线。我把“image-png”而不是“image/png”作为图标类型。
    猜你喜欢
    • 1970-01-01
    • 2019-11-06
    • 2020-08-28
    • 2013-09-04
    • 1970-01-01
    • 1970-01-01
    • 2022-11-13
    • 2017-11-11
    • 2021-09-25
    相关资源
    最近更新 更多