Android: failed to convert @drawable/picture into a drawable

前端 未结 14 1987
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 10:16

In my drawable folder I have a few images and they all reference perfect, but when I try and add any more images with the exact same size in the same folder, and try to refe

14条回答
  •  悲哀的现实
    2020-12-02 10:47

    For Android Studio I had this same problem. It was caused by running from linux, meaning the files did not automatically receive an extension. By manually adding .png to the end of the filenames it could recognize the filetype and load accordingly.

    Android studio might throw a hissy fit if you try to refactor rename inside the project, because android will try to regenerate R immediately. I do not know exactly what causes the error as it points to some seemingly random line of code, which in my case was a comment.

    Solution to that: Delete from drawable, rename outside of the project and throw them in again.

提交回复
热议问题