无法安装网站:从清单下载的图标为空或损坏 [英] Site cannot be installed: icon downloaded from the manifest was empty or corrupted
本文介绍了无法安装网站:从清单下载的图标为空或损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我遇到错误
无法安装站点:从清单下载的图标为空或损坏
Site cannot be installed: icon downloaded from the manifest was empty or corrupted
我找不到问题所在.以下是我的 manifest.json
.我正在将Angular 4 Progressive Web应用程序用于材料设计.
I'm not able to find what is the problem. Below is my manifest.json
. I'm using Angular 4 Progressive web app with material design.
Manifest.json
Manifest.json
{
"dir": "ltr",
"lang": "en",
"name": "Hello",
"scope": "/",
"display": "standalone",
"start_url": "./?utm_source=web_app_manifest",
"short_name": "Hello",
"theme_color": "#f27b00",
"description": "",
"orientation": "any",
"background_color": "#3a1c8d",
"related_applications": [],
"prefer_related_applications": false,
"icons": [{
"src": "/assets/icons/android/android-launchericon-512-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "/assets/icons/android/android-launchericon-192-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/assets/icons/android/android-launchericon-144-144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/assets/icons/android/android-launchericon-96-96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/assets/icons/android/android-launchericon-72-72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/assets/icons/android/android-launchericon-48-48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/assets/icons/chrome/chrome-extensionmanagementpage-48-48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/assets/icons/chrome/chrome-favicon-16-16.png",
"sizes": "16x16",
"type": "image/png"
},
{
"src": "/assets/icons/chrome/chrome-installprocess-128-128.png",
"sizes": "128x128",
"type": "image/png"
}
],
"gcm_sender_id": "XXXXXXXX"
}
推荐答案
As stated in this document - Customize the icons, when placing the src
path of the icon, it must refer to the root directory. You should change the path by removing /
at the beginning and compile it again.
"icons": [{
"src": "images/touch/icon-128x128.png",
"type": "image/png",
"sizes": "128x128"
}, {
"src": "images/touch/apple-touch-icon.png",
"type": "image/png",
"sizes": "152x152"
}, {
"src": "images/touch/ms-touch-icon-144x144-precomposed.png",
"type": "image/png",
"sizes": "144x144"
}, {
"src": "images/touch/chrome-touch-icon-192x192.png",
"type": "image/png",
"sizes": "192x192"
}],
您还可以查看此相关的SO帖子以供参考.
You can also check this related SO post for reference.
这篇关于无法安装网站:从清单下载的图标为空或损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文