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

[web]: How to find an example of AssetManifest.json? #33402

Closed
mirkancal opened this issue May 27, 2019 · 13 comments
Closed

[web]: How to find an example of AssetManifest.json? #33402

mirkancal opened this issue May 27, 2019 · 13 comments

Comments

@mirkancal
Copy link

mirkancal commented May 27, 2019

I get a warning in console with my flutter_web app.

Asset manifest does not exist at assets/AssetManifest.json – ignoring.

I want to add that file, how can I find example of it?

My app is on Github pages and I'm using chrome to open it.

Version 74.0.3729.169 (Official Build) (64-bit)

Edit: I've added AssetManifest.json file which consist only {}. It solved my problem, but what to put in AssetManifest.json? I couldn't find any guide about it.

@superciccio
Copy link

that's the file
https://github.com/flutter/flutter_web/blob/master/examples/gallery/web/assets/FontManifest.json

@mirkancal
Copy link
Author

It's FontManifest.json. Is it same?

@superciccio
Copy link

yep
https://github.com/flutter/flutter_web/blob/master/docs/migration_guide.md#webassetsfontmanifestjson-optional

@mirkancal
Copy link
Author

I can't see any indication of that. Where it says exactly that AssetManifest.json and FontManifest.json files are the same?

@caztial
Copy link

caztial commented Jun 3, 2019

I think without the AssetManifest.json release build images are not available

@Levi-Lesches
Copy link
Contributor

Am I supposed to replace FontManifest.json with AssetManifest.json? Or do I put the same content in both?

@abinmittu
Copy link

Sample AssetManifest.json

{
  "assets": [
    "images/my_image_1",
    "images/my_image_2"
  ]
}

Directory Structure

web
    - assets
        - fonts
        - images
            - my_image_1
            - my_image_2
        - AssetManifest.json
        - FontManifest.json

@Levi-Lesches
Copy link
Contributor

Thanks so much

@shivamenrichai
Copy link

can u give some example to use in dart file, not working web build

@Levi-Lesches
Copy link
Contributor

What do you mean by Dart file? Like, how to refer to the assets?

@jonahwilliams
Copy link
Member

If you're using the flutter tool to build you application the asset manifest is generated automatically. For more information see flutter.dev/web. I'm closing the issue since it is no longer relevant.

@NothingWorksToday
Copy link

If you're using the flutter tool to build you application the asset manifest is generated automatically.

Sorry to comment on such an old issue. Does it still get generated? Where is it placed - in the rootBundle? How can I access it? So far I accessed my other assets with

content = await rootBundle.loadString('assets/my_asset_file.json');

Is it the same for AssetManifest.json? Like

content = await rootBundle.loadString('assets/AssetManifest.json');

@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants