Android Studio does not recognize images

Asked

Viewed 927 times

0

inserir a descrição da imagem aquiinserir a descrição da imagem aquiGuys, my Android Studio here is not recognizing the images I put in the drawable folder. I dragged six images there, three of them I could access normally, the other three I can’t. Any idea? To test I tried to add other images and access them and also could not.

They are all png, all names in lowercase. Detail: If I don’t try to access these images, the project compiles normally. Link to problematic project if anyone is curious:

https://www.dropbox.com/s/62cocsmfihgnjgp/MyTools.zip?dl=0

  • The length of all your images are the same?

  • Yes yes, all the same! Names all in Ower case too!

2 answers

1


To reference the images in the folder drawable, the correct is to use R.drawable.recurso

  • Jesus beloved! It worked! Man, thank you very much! I was doing so because I learned so in the course I’m doing here (online). Thanks a lot, I have a couple of hours I try to figure out the problem.

  • I’m glad it worked! Remember to accept the answers that help you so that people who also have the same problem can find a solution more easily. =)

0

Take a look at the format of the image, maybe they can be in a format that the android studio can not read, always try to use . png, to change the format you can use photoshop or any other program that does it.

  • They are all in png format, very strange!

  • you could post a print of how it looks in the app or part of the code, so I can help you better

  • I posted it upstairs! I put the project in Dropbox too! In the image you can see that the other images are recognized normally. Add all together, already tried to rename, reload in folder, put other images and still nothing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.