Support library VectorDrawable Resources$NotFoundException

前端 未结 14 1378
你的背包
你的背包 2020-11-29 18:40

I am using Design Support Library version 23.4.0. I have enabled the gradle flag:

defaultConfig {
    vectorDrawables.useSupportLibrary = tr         


        
14条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 18:43

    I had the same problem and actually what was missing is I was using app:srcCompat on AppCompatTextView except of AppCompatImageView.

    The way I have found the problematic part:

    My error looks like:

    Fatal Exception: android.content.res.Resources$NotFoundException
    Resource ID #0x7f0700d1
    

    Here are the steps I followed the resource id of the mentioned drawable :

    • APK Analyzer -> classesXXX.dex
    • In this dex file I opened the directory of my apps package name and went to R$drawable file
    • R$drawable -> Show as byte code.
    • Search for ID [0x7f0700d1] (check your own ID)
    • Find the image and check for all the usages (CMD + F7) of the resource
    • Fix

    Hope it will help somebody.

提交回复
热议问题