Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml

后端 未结 18 905
野性不改
野性不改 2020-11-27 15:49

After solving a JDK zero value error, now I\'m facing this one. I did a little research, but it seems I can\'t get to the point. Here is the log error:

FATA         


        
18条回答
  •  一个人的身影
    2020-11-27 16:05

    use like this in your Activity:

    public class MainActivity extends AppCompatActivity {
        static {
            AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
         }
      ...
    }
    

    and this in your build.gradle :

    android {
        ...
    
         defaultConfig {
             ....
             vectorDrawables.useSupportLibrary = true
        }
    

    }

    and in your xml:

    app:srcCompat="@drawable/your_icon"
    

提交回复
热议问题