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

后端 未结 18 896
野性不改
野性不改 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条回答
  •  旧时难觅i
    2020-11-27 16:08

    I ran into this issue in Xamarin.Android with Xamarin.Android.Support.Design 24.0.2. Here is how I solved it:

    Added the following line to my Application class OnCreate:

    AppCompatDelegate.CompatVectorFromResourcesEnabled = true;
    

    Replaced:

    var upArrow = ContextCompat.GetDrawable(this, Resource.Drawable.abc_ic_ab_back_material);
    

    With:

    var upArrow = ResourcesCompat.GetDrawable(Resources, Resource.Drawable.abc_ic_ab_back_material, null);
    

提交回复
热议问题