add to homescreen - manifest.json file throwing error

12 views
Skip to first unread message

Srinivas Podalakuru

unread,
Jun 22, 2018, 1:04:46 AM6/22/18
to Angular and AngularJS discussion
Hi,

purpose of my project is to achieve "add to homescreen" functionality. In that process I have created manifest.json with all the necessary specs (as attached) and referred the manifest file in the index.html (root template), but after launching the app and looking in the "dev tools->application->manifest" it's displaying error as attached. The manifest file is created in the src folder of the application on same level as the index.html. Any help about , why it errors, would be highly appreciated. I tried hard to fix the issue but no luck!

manifest.json file:
{
"short_name": "Genworth",
"name": "Genworth.com",
"icons": [
{
"src": "/assets/images/rateexpress128.png",
"type": "image/png",
"sizes": "128x128"
},
{
"src": "/assets/images/rateexpress144.png",
"type": "image/png",
"sizes": "144x144"
}
],
"start_url": "/",
"background_color": "#ffffff",
"display": "standalone",
"scope": "/",
"theme_color": "#fff"
} 

Index.html:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Testproject</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="manifest" href="/src/manifest.json">
</head>
<body>
<app-root></app-root>
</body>
</html>



Thanks
Srinivas
manifest error.png

Sander Elias

unread,
Jun 22, 2018, 1:18:30 AM6/22/18
to Angular and AngularJS discussion
Hi Srinivas,

Move it into your assets folder, and link to that location. Your manifest is an asset that should be copied as-is. No files outside off assets will be copied over to your distribution. The CLI builds your application from there, but it doesn't copy. (for good reasons)

Regards
Sander

Srinivas Podalakuru

unread,
Aug 1, 2018, 4:20:55 PM8/1/18
to ang...@googlegroups.com
Thanks Sander. It’s been done. 

Sorry for late reply. 

Thank you. 

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
Thanks
Srinivas
Reply all
Reply to author
Forward
0 new messages