AAPT error: resource drawable/… not found

前端 未结 14 1649
粉色の甜心
粉色の甜心 2020-12-10 23:44

After recently upgrading my android studio, I am not able to build my project anymore.

Every time I execute a build, I am struck with the following error:

         


        
相关标签:
14条回答
  • 2020-12-11 00:32

    In my case it was malformed splash_screen.xml which was part of "reverted commit" which actually deleted this file, but somehow it was still may be it was in active changelist.

    Fixed that file and solved issue.

    0 讨论(0)
  • 2020-12-11 00:36

    I fixed the error, which was probably coming from a mal-formatted copied XML file (probably some line-ending confusion)

    Rewriting those fixed the error, although Android Studio displayed another file as the source of the problem, which in fact had nothing to do with the error itself.

    0 讨论(0)
  • 2020-12-11 00:36

    I faced the same problem while building a release version of my app the problem was that i had some important res files of my project inside the debug directory instead of having them inside the release dir so i fixed the problem by moving the files that were in debug inside release you can check it by viewing your project tree under project instead of android

    0 讨论(0)
  • 2020-12-11 00:39

    In my case, it was a drawable resource file that required a higher API version as it was my minSdkVersion set in build.gradle. The main problem was that the file did not show any error until you opened it, so it was hard to find it at all. I have spent at least 4 hours trying other things, since as an error when building the project it showed other drawable resource files that did not have any problems at all. After removing the drawable that required the higher API the app built normally.

    0 讨论(0)
  • 2020-12-11 00:40

    in my case i like this : <?xml version="1.0" encoding="utf-8"?><?xml version="1.0" encoding="utf-8"?>

    so i just remove one of them

    0 讨论(0)
  • 2020-12-11 00:41

    In my case it was an xml selector. In the first line I had two of these (thanks to copy paste among my files):

    <?xml version="1.0" encoding="utf-8"?>
    

    and Android Studio didn't give any warning or something. Removing it fixed the problem but it needed a full clean build afterwards.

    0 讨论(0)
提交回复
热议问题