I've made PWA I hosted locally, and it was working fine. Once I uploaded everything to a hosting service it seems to just not work anymore. I checked Lighthouse and it mentioned that there is something wrong with the manifest file.
Heres the message Lighthouse gave me.
I'm confused on why there is a problem with the manifest file since it worked fine on the local host.
Heres the manifest.json file:
{
"name":"Punto Tuzo",
"short_name":"PuntoTuzo",
"start_url":"https://puntotuzo.epizy.com",
"icons": [
{
"src": "icons/manifest-icon-192.maskable.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "icons/manifest-icon-192.maskable.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/manifest-icon-512.maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "icons/manifest-icon-512.maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color":"#000000",
"background_color":"#FFFFFF",
"display":"fullscreen",
"orientation":"portrait"
}
Is there way I can fixt this issue? Thank you for your help and time.
Originally, I thought it had something to do with the "start url" since in the local host version it had the following:
"start_url":"/?home=true"
So, I changed it to the sites URL:
"start_url":"https://puntotuzo.epizy.com"
But it looks like that wasn't it since nothing really changed.
The error is correct. You are not introducing a service worker which will handle the offline version of the page.
Please read this page VERY carefully: https://developer.chrome.com/blog/app-install-banners-native/?utm_source=xron.net
Especially the parts about prefer_related_applications and related_applications and the Special considerations for when using content security policy at the bottom of the page, about CSP.
Related
i have problem with the start_url And i dont know why is this code wrong i searching on all forums and internet but i cant found the answer for this, the Lighthouse say this:
Does not register a service worker that controls page and start_url
The service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. Learn more.
and if i add on the manifest.json add start_url: still dont works i found only one answer is use scope: but is still dont works.
{
"name": "Heexy",
"short_name": "Heexy",
"description": "Heexy is the private and fast search engine without ads!.",
"lang": "en-US",
"start_url":"/?start=url",
"scope": ".",
"display": "standalone",
"theme_color": "#03adfc",
"background_color": "white",
"icons": [
{
"src": "https://cdn.heexy.org/images/logo.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}
You must add service-worker.js script
i created a json file with all the data required for my app, it was working fine but one image was showing error saying that it is from another domain, so i changed the image address to another image, and now it says
crbug/1173575, non-JS module files deprecated
i tried changing it back to the previous image and restarted the application it still shows the error.
{
"id": 1,
"name": "92.7",
"tagline": "on the ground by Rose",
"color": "blue",
"url": "https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png" ,
"img": "https://preview.redd.it/ls2yuc4501l61.jpg?width=512&auto=webp&s=be785e98bf288f69c0b0105fb2bce6ab807b20f4",
"category": "blackpink",
"disliked": false,
"order": 1
},
{
"id": 2,
"name": "92.7",
"tagline": "blood sweat and tears by BTS",
"color": "blue",
"url":"https://upload.wikimedia.org/wikipedia/en/5/51/Google_Chrome_on_Windows_10_screenshot.png" ,
"icon": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a5/Google_Chrome_icon_%28September_2014%29.svg/96px-Google_Chrome_icon_%28September_2014%29.svg.png",
"img":"https://m.media-amazon.com/images/M/MV5BZTQ3YmU4MjAtYzQ0NC00NjRjLThmMzYtMTE4MzgzMWJkNjliXkEyXkFqcGdeQXVyNDY5MjMyNTg#._V1_.jpg",
"category": "BTS",
"disliked": false,
"order": 2
}
Error was in the first pic, the second was showing fine but after changing it , now it doesnt start the application and shows the error i mentioned above. I'm using google chrome to run the application.
Delete your launch.json file as it is causing your app to not launch with the default configuration of flutter
I encounter the same error in one of my flutter web projects. you have to delete the launch.json file.
Here is path of file
.vscode -> launch.json
just delete launch.json and your project will run.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"request": "launch",
"name": "Launch Chrome against localhost",
"type": "dart"
}
]
}
iPadOS 13 now shows a white/grey bar when a WebApp is installed via 'Add to Home Screen' on Safari, even when apple-touch-fullscreen meta tag is added. The bar includes a menu to resize font and request desktop site, but has affected the available screen size so that the users now have to scroll to view the app menu.
Is there any way to hide this bar, such as forcing either Desktop/Mobile site so that the selection is not required?
I have found out the solution to this.
iPadOS does add the url bar to web apps even if the apple-touch-fullscreen meta tag is added, but now uses the manifest.json file used with Progressive Web Apps (PWA) to detect fullscreen mode. It has supported this before version IOS 13 but only now is it required for the fullscreen experience.
In my application the manifest.json link tag <link rel="manifest" href="manifest.json"> was ONLY being added when Google Chrome is detected; updating it to add the link when Safari on the iPad is detected resulted in the grey bar being hidden completely (Note that iPad detection has changed in this version now that mobile/desktop versions can be requested)
The manifest.js file that allowed fullscreen is shown below (display: "standalone" allows fullscreen)
{
"name": "MyApp",
"short_name": "MyApp",
"description": "MyApp description",
"version": "0.0.0.1",
"manifest_version": 2,
"default_locale": "en-GB",
"author": "Christopher Dean",
"start_url": "Home.aspx",
"display": "standalone",
"orientation": "landscape",
"theme_color": "#015174",
"background_color": "#F7F4F3",
"icons": [
{
"src": "images/app-icon-chrome.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "images/app-icon-tiny.png",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "images/app-icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "images/app-icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"app": {
"urls": [
"http://MyApp/Home.aspx"
],
"launch": {
"web_url": "http://MyApp/"
},
"background": {
"scripts": [ "chrome.js" ]
},
"permissions": [
"unlimitedStorage",
"notifications",
"fullscreen"
]
}
}
I have created a web app, PWA, and made it possible to add to Homescreen. When I add it to my mobile and try to open it, it doesn't open and Chrome stops working.
The same web app is working when launched from a desktop.
Here my manifest file:
{
"gcm_sender_id": "********",
"name": "*** **",
"short_name": "***",
"description":"**",
"icons": [{
"src": "icons/** 512x512.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "icons/** 512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": "/",
"display": "standalone",
"background_color": "#032d31",
"theme_color": "#032d31"
}
If you want you can have a look at an article I wrote about it, maybe you find a missing setting.
Another thing: "gcm_sender_id"is obsolete and no more used (maybe this triggers the error). You should use FCM now (Firebase Cloud Messaging) that implements the Web Push interface and does not need to put anything in the web manifest.
I had generated a manifest file with icons, later i decided to just change the icons folder with different icons(by copying & paste and overriding) when i did that I get the following error in chrome devtools as i click add to home screen in the application tab:
Error while trying to use the following icon from the Manifest:
https://x.firebaseapp.com/icons/icon-144x144.png (Resource size is not
correct - typo in the Manifest?) x.firebaseapp.com/:1 App banner not
shown: no icon available to display
However, on chrome mobile the icon is updated(confirmed using add to homescreen)
{
"name": "Duckr",
"short_name": "Duckr",
"theme_color": "#2196f3",
"background_color": "#2196f3",
"display": "standalone",
"orientation": "portrait",
"Scope": "/",
"start_url": "/",
"icons": [
{
"src": "icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"splash_pages": null
}
icons/icon-144x144.png image should have width 144px and height 144px
You can check your manifest in your application tab in chrome inspect
https://developers.google.com/web/tools/chrome-devtools/progressive-web-apps#add-to-homescreen
Is the icon actually 144px by 144px? That's what the error suggests to me.
Error-"Error while trying to use the following icon from the Manifest:"
When I modifed the manifest.json with following change , it worked for me .
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
This might help someone who is facing a similar issue.
I do not see any response that resolves your comment, and I was also playing with the Manifest of my PWA and got this problem in my response headers of the element inspector.
GET http://localhost/android-icon-144x144.png 404 (Not Found)
(index):1 Error while trying to use the following icon from the Manifest: http://localhost/android-icon-144x144.png (Download error or resource isn't a valid image)
And it's just that you need to point your image where your favicon is and change in ** manifest.json ** the key:
"icons": [
{
"src": "/favicon/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
}
]
And in your application place the following path.
<link rel="icons" type="image/png" sizes="144x144" href="/favicon/android-icon-144x144.png">
If you do with a favicon generator you will get the different rel like this:
<link rel="icon" type="image/png" sizes="144x144" href="/favicon/android-icon-144x144.png">
Don't know if it's a good solution or not but commenting following lines worked for me :
{
"src": "icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
As, I checked into images folder image of mentioned size were not present either
avail image of that size or comment that size in manifest.
if you don't want to see this error go to your public folder and then to your index.html and delete this links if you have accidentally removed the icon image logo192.png or this link manifest.json or try changing the sizes in your manifest.json file
Image size needs to fit size written in manifest.json
If you know the size is right, try renaming both the icon file and the icon name inside manifest.json to something else. There's some "black magic" caching going on (and CTRL-F5 won't work). This way you force it to think it's changed.
I have just met this error when I change my --script-version 1.1.5 to 1.0.13. I resolve it by changing my manifest.json like:
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
]
This happened because u changed the picture:
So u need to update the old name of that picture in manifest json with the new one Example In manifest json my image source was logo192.png ,size 192*192
i downloaded an image named android.png of same size
so I replaced the name of source-SRC from logo192.png to android.png.
IT WORKED