-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
unable to load image/assets #17870
Comments
Please add |
-----pubspec.yaml------
|
-----flutter doctor----- C:\flutter_windows_v0.4.4-beta\flutter\bin\flutter.bat --no-color doctor • No issues found! |
what was the fix? i'm having the same issue with the flutter sample app |
Probably just ensuring that the asset path in pubspec.yaml is correct. |
Looks like it was some issue with the image provided and loading it on the emulator. I tried a different, smaller image and it worked fine. ** I take that back, it's now loading fine. Maybe a whitespace issue in pubspec.yaml? |
honestly have no clue, it's working fine now and I didn't do anything other than add a second image to pubspec.yaml file. ¯_(ツ)_/¯ |
|
Incorrect espace ------------
Correct is ------------------
|
I have the same issue. I've just run "$ flutter clean", then everything is OK. |
@mrlinhhandsomevn are you on latest Flutter version? |
i have this issue, i have my path in pubspec.yaml
|
@MikeMcflako I'd suggest to ask on StackOverflow with more details. |
If any of you using Windows \ rather than /, worked for me!!! |
@Achileas I think that is worth a new issue. It shouldn't be necessary to use |
Your Right!!! but sad :(
…On Wed, Nov 7, 2018 at 4:51 PM Günter Zöchbauer ***@***.***> wrote:
@Achileas <https://github.com/Achileas> I think that is worth a new
issue. It shouldn't be necessary to use \.
A Flutter project should work the same on Windows, Linux, Mac without
changes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17870 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVSqkMZeVuNoZNAJdHtROflznC25hy_0ks5usuVDgaJpZM4UMR3L>
.
|
I wish i could make heads or tails out of this subject.. should not be this hard to add image assets.. Can anyone make this clear?? the docs do not give me a clue and here i get more confuised as there are three or four examples that should work |
@mudgesteve check your yaml with http://www.yamllint.com/ Please consider asking support questions in one of the other channels listed at http://flutter.io/support . |
Sure, thanks,
I am newbie
Please forgive my lack of knowledge, I'm old man but quick study
…On Sun, Jan 20, 2019, 3:34 AM Günter Zöchbauer ***@***.*** wrote:
@mudgesteve <https://github.com/mudgesteve> check your yaml with
http://www.yamllint.com/
Please consider asking support questions in one of the other channels
listed at http://flutter.io/support .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17870 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Arh4gtSp06BTMkWXXrvslpwPupAJ0gkMks5vFFQ3gaJpZM4UMR3L>
.
|
@mudgesteve no worries. I just try to point people where they might have better chance of getting solutions. We don't have the bandwidth for individual support here. |
Cool, tks
…On Sun, Jan 20, 2019, 3:46 AM Günter Zöchbauer ***@***.*** wrote:
@mudgesteve <https://github.com/mudgesteve> no worries. I just try to
point people where they might have better chance of getting solutions. We
don't have the bandwidth for individual support here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17870 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Arh4gh0kQ22tgST7G06mhPWzL5A7hhXvks5vFFcEgaJpZM4UMR3L>
.
|
Just to add to the list, running
I couldn't call |
The other reason may be because of the path mentioned in the code try changing the path from AssetImage("/image/img.jpeg") I know both are similar but this worked for me! |
I will be straight: there is typo in original author post
Double "b"
After correct those typos (maybe using copy & paste) again you can run |
I have this issue, and fix it, |
oh man it fucking worked thank u <3 |
I am having the same issue. I have tried
This is the code where I am accessing the image
Error (Just in case):
Output of
|
@astanwar99 according to the documentation , you should not use the second type of documentation you mentioned on your comment. As in the documentation:
After writing the last paragraph, I noticed you are using hot reload. I had that same problem and sometimes the only option is to use hot restart or even rebuild the app again. The identations are important, just like in Python, as it guides itself with them. Try using other ways to display an Image, as there is a couple of classes with similar functionalities. It came to me as a surprise when it happened, but after running |
It worked for me:
Whole folder not worked for me
|
The issue is resolved now. I am not sure how but I didn't change anything. What I did was:
As of now its showing no error but earlier it showed error 4-5 times before running successfully. I may be wrong but maybe it was happening because of some memory latency as my Android Studio is in SSD and the project is in HDD. Thanks for all the help. |
As a new guy but kinda old in Android. Whenever you add an asset on fly don't forget packages get. Since its configured from the yaml. Had same issue still learning flutter. |
@ToxaDev At least that's how it worked back when folder support was originally added. There's a reliable way to know what files are added according to what you write on pubspec: It doesn't hurt to do Source: I added that code and updated docs back then, though haven't checked for changes in over almost 2 years. |
yaml file looks for the indentation and it takes 2 spaces |
observe o tamanho da imagem, se for muito grande, o androis Studio nao consegue exibir. O tamanho que me refiro é os pixels de altura e largura. Dependendo de onde a imagem vai aparecer, não ha espaço. |
it seems a lot of image loading issues got to do with proper indentation. I have loaded bigger images i takes longer to load the file but works. if it helps anybody |
thanks for all, now its working |
this worked for me too |
Please don't use back slashes, if someone tries to compile your project outside windows it's probably going to fail. Also there's nothing assuring that a future commit will reject back slashes or treat them as escape character sequence. Then your own project won't compile anywhere. |
so basically it's a "sometimes it works sometimes it doesn't" type of thing. what is this |
example:
|
ok |
Encountered this issue when following the Flutter layout tutorial at https://flutter.dev/docs/development/ui/layout/tutorial Once got to "Step 5: Implement the image section" I followed the instructions but made a typo on the pubspec.yaml (wrote "images/lage.jpg" rather than "images/lake.jpg"), saved, and triggered a hot reload. Obviously I got an error related to the typo, but even after fixing it and triggering another hot-reload I got into the error everyone here is complaining about. Turns out that to get rid of it even AFTER fixing the typo in pubspec.yaml I had to trigger a full rebuild (STOP button then PLAY button in Android Studio interface) rather than using hot-reload. |
when images not loaded into app encountered this issue in pubspec.yml file paste uses-material-design: true To add assets to your application, add an assets section, like this:assets: |
Just make sure your data connection is on |
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 |
The text was updated successfully, but these errors were encountered: