Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating androidTWA package (Unexpected token  in JSON at position 0) #1809

Closed
d3viance opened this issue Jun 15, 2021 · 6 comments

Comments

@d3viance
Copy link

I received the following error when generating a package for https://wise.tms.kimclark.com/tms/
I tried lots of things, but i cant find what's wrong with the manifest file...

Although, when i open the app on brower it works (service worker and stuff...)
But i want to publish it to Google play and therefore to export it to APK.

Thank you for help.

Error generating Android package.

Status code: 500

Error: Internal Server Error

Details: Error generating app package: FetchError: invalid json response body at https://wise.tms.kimclark.com/tms/manifest.json reason: Unexpected token  in JSON at position 0

@ghost ghost added the needs triage 🔍 label Jun 15, 2021
@ghost
Copy link

ghost commented Jun 15, 2021

Hello d3viance, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will investigate the issue and help solve it ASAP. Other community members may also look into the issue and provide feedback 🙌

@davrous
Copy link
Contributor

davrous commented Jun 28, 2021

Hi @d3viance, thanks for the report. I'm reproducing the error, you normally need a 512x512 icon to generate a package but your issue is also raising another bug.

Pinging @JudahGabriel for the Android issue and @jgw96 for the 512x512 check that didn't happen.

@jgw96
Copy link
Contributor

jgw96 commented Jun 28, 2021

@JudahGabriel the error modal is now showing for this one as it should, also while debugging I noticed this
image
maybe related to CloudFlare?

@JudahGabriel
Copy link
Contributor

JudahGabriel commented Jun 29, 2021

Hi @d3viance

I think this is a legit issue with your manifest file.

Specifically, I suspect your manifest JSON file has a unicode character as the first character in the file - possibly a zero-width no break space character. See this bug that had the same issue as you.

Indeed, if I open the file as binary in Visual Studio, I see some suspicious first bytes that render it as invalid JSON:

image

Something quick to try that may fix it:

Open your manifest.json inside Notepad++ and save it as ANSI. That should remove this weird character at the beginning of your JSON. Replace your existing manifest.json with this new file and things will start working, I suspect. Give it a try?

@JudahGabriel
Copy link
Contributor

I see your manifest has now been fixed and is properly detected by PWABuilder. Closing.

@d3viance
Copy link
Author

d3viance commented Jul 9, 2021

Thanks it works!!!

Hi @d3viance

I think this is a legit issue with your manifest file.

Specifically, I suspect your manifest JSON file has a unicode character as the first character in the file - possibly a zero-width no break space character. See this bug that had the same issue as you.

Indeed, if I open the file as binary in Visual Studio, I see some suspicious first bytes that render it as invalid JSON:

image

Something quick to try that may fix it:

Open your manifest.json inside Notepad++ and save it as ANSI. That should remove this weird character at the beginning of your JSON. Replace your existing manifest.json with this new file and things will start working, I suspect. Give it a try?

@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants