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

MDC-102 Flutter: Material Structure and Layout (Flutter) - Image not Listed #42

Closed
TejaDroid opened this issue Jun 21, 2018 · 12 comments
Closed

Comments

@TejaDroid
Copy link

Hello,
I am integrate full project with using the codelabs instruction, there app running well but does not shows any of images,
let any body know, what the wrong with me in code.

@MrSCAN
Copy link

MrSCAN commented Jun 21, 2018

Is not your code, I think
the image assets wasn't uploaded

@TejaDroid
Copy link
Author

Nothing has been change then also there not visible images, else working fine. the project same as repository.

@willlarche
Copy link
Collaborator

Hi, @TejaDroid . Sorry you're having trouble. I'll look into this right now.

@willlarche
Copy link
Collaborator

willlarche commented Jun 22, 2018

The images used in Shrine exist in an outside package called shrine_images that's hosted by Dart pub at https://pub.dartlang.org/packages/shrine_images. The pubspec.yaml file for the codelabs includes a reference to this dependency that causes it to be downloaded during packages get or packages upgrade which happens when you restart your project.
screen shot 2018-06-22 at 10 37 59 am

The pubspec.yaml file also has each of the files from that package listed by name so the app knows which images need to be treated as assets. In 102, the code that reads these images is in home.dart in the _buildGridCards() function when an Image widget is added as a child to the AspectRatio widget:
screen shot 2018-06-22 at 10 43 22 am

You're instructed to add code for loading these images during 102's 6th step "Make a card collection":
screen shot 2018-06-22 at 10 46 28 am

Make sure you didn't forget to do that or forget to add the line package: product.assetPackage,. Without that property, the app won't know which package the images are in.

You can also compare what you have against what's in the branch called 103-starter_and_102-complete. This code should match what you have when you complete every instruction in the 102 codelab.

@willlarche
Copy link
Collaborator

willlarche commented Jun 22, 2018 via email

@WillGeller
Copy link

WillGeller commented Jul 26, 2018

I am still having this exact issue, even when running right off the 103-starter_and_102-complete branch.

Here is the result of flutter upgrade

Upgrading Flutter from /Users/willgeller/Documents/house-work/Flutter-Dev/flutter...
From https://github.com/flutter/flutter
 * [new branch]          Hixie-patch-2 -> origin/Hixie-patch-2
   c1de12dd4..70791c308  master        -> origin/master
Already up-to-date.

Upgrading engine...
Already up-to-date.

Flutter 0.5.1 • channel beta • https://github.com/flutter/flutter.git
Framework • revision c7ea3ca377 (8 weeks ago) • 2018-05-29 21:07:33 +0200
Engine • revision 1ed25ca7b7
Tools • Dart 2.0.0-dev.58.0.flutter-f981f09760

Running "flutter packages upgrade" in mdc_100_series...      4.6s

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13 17A365, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    ✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To install:
        brew install cocoapods
        pod setup
[✓] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2017.3.5)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] VS Code (version 1.25.1)
[✓] Connected devices (1 available)

@willlarche
Copy link
Collaborator

Sorry about that!

I need some more info:

  1. Are you running this from inside Android Studio or at the terminal with flutter run?
  2. Does the console spit out any errors related to the images?

@willlarche willlarche reopened this Jul 26, 2018
@WillGeller
Copy link

Funny, Images load fine when I run on my actual device! But, they don't show up when running in my Android Simulator.

No console errors related to images, I am using VS-Code as my editor and same result whether hitting run in the debugger or flutter run in the terminal.

@willlarche
Copy link
Collaborator

So, the Flutter team is interested in this since there's nothing obviously wrong. I'd love it if you could give some more information:

What OS is your computer?
Which model of phone are you emulating?
Is your Android Studio up-to-date?

@WillGeller
Copy link

WillGeller commented Jul 31, 2018

  • OS X High Sierra v10.13
  • Emulating Pixel 2 XL API 26:5554
  • Android Studio v3.1.3

Update I actually went and updated the packages within Android Studio and it looks like the emulator was out of date. After that updated the images show up.

Feel free to close.
PS. Flutter is awesome!

image

@willlarche
Copy link
Collaborator

Oh awesome! Thanks so much for letting me know and for using Flutter!

@Nyxie12
Copy link

Nyxie12 commented Apr 14, 2020

Hi there, I have the same issue. Unable to see image. Irony is same code works fine on windows machine running with android simulator while does not show on mac with iOs Simulator.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants