image Asset Studio not available in flutter projects

7,035

Solution 1

to create an Image asset in flutter you need to do the following:

1 - in project view mode, right-click on your root project and choose new directory; and give it a name images

2 - go to pubspec.yaml file and find the assets section. it will be commented so uncomment it then add your directory to the assets. it should look like this:

assets:
  - images/             

be careful with the indentation though. it won't work if your indentation is not correct.

then you can use all the image assets that you add to that directory in your project.

if you need more clarifications, let me know in the comments!

Solution 2

enter image description here

right-click anywhere on your flutter project > Flutter > Open Android Module in Android Studio.(new window) it's gonna ask you to update Gradle on the bottom right, update it. wait a bit.

once updated, right-click on the res folder and the option should be available.

enter image description here

Solution 3

Open just the android folder of flutter project in android studio.

Then you can see the image asset studio is available.

Here's a link.

https://github.com/flutter/flutter-intellij/issues/3512

Solution 4

You have to create flutter project firstly using Android Studio rather than using VS code. After project was created, you can open it on VS code and start coding... otherwise you won't be able to access android studio modules and some options such as either Vector asset or Image asset . hope you'll get this.

Share:
7,035
Davies
Author by

Davies

Updated on December 19, 2022

Comments

  • Davies
    Davies over 1 year

    I want to create a new icon using the assets tool as described here. Surprisingly, the option to create an image set is missing in the context menu:

    Screenshot

  • stevegt
    stevegt almost 3 years
    Hi Francisco, welcome to SO! You'll want to include images in answers, rather than links, so the answer is still readable years from now.
  • stevegt
    stevegt almost 3 years
    Yep -- my bad. Thought of that a few minutes after it went by in my review queue and didn't get back here quickly enough. ;-)
  • Nuwan Thisara
    Nuwan Thisara over 2 years
    is there anything I can do to fix it later if I started the project in VS code?
  • Nuwan Thisara
    Nuwan Thisara over 2 years
    This question is about Image asset studio, but this answer is about adding images to a flutter project. I think those are two different things.