AAPT error: resource drawable/… not found

前端 未结 14 1647
粉色の甜心
粉色の甜心 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:22

    In my case I delete namespace declaration Duplicate like xmlns:android="http://schemas.android.com/apk/res/android" and i used Analyse -> inspect code tool to show the error in the log, and i resolve the error in other files xml in drawable resource.

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

    In my case , I used a wrong reference to the android resource file i.e android:color/splash_bg instead of @color/splash_bg

    where splash_bg represents my custom color resource declared in res/values/colors.xml file.

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

    I had the same problem and I solved it when I added my icons in the drawable file to 24dp.

    Copy any icon you want and paste it in the drawable file, and it will create (by default) 24dp icons.

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

    Check your each and every XML and maybe you will find the following situation.

    • While coping code or files from other projects, maybe you forgot to add some resources like drawable, strings.

    • Check each drawable files, may Android Studio will highlight when you open that file.

    Sometimes this type of error we have to find because of Android Studio stuck with errors.

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

    In my case, the problem is code conflict, other person changed the same file with me. The resource code is changed. When I fix the file, the problem is gone.

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

    while copy and pasting code I also pasted below line

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

    Since,my xml file already contain above line and on adding this line it appear twice .

    so I remove one of these line and it resolve my error

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