0

I'm creating a class library in Xamarin.Android platform and having XML files in Resources/drawable-v21 folder. While running the library in API 23, API 24 then the app is running successfully. But while running the library in API 21 or API22 then the library throws "Android.Content.Res.Resources+NotFoundException: File res/drawable-v21/btn_XXXX.xml from drawable resource ID #0x7f020055" exception at the this.SetButtonDrawable(Resource.Drawable.btn_XXXX); line.

Can anyone help me to resolve this issue?

note: I'm running it in 5.7" Lollipop (5.0) XXHDPI Phone (Android 5.0 - API 21) emulator

sarath kumar
  • 209
  • 5
  • 12

1 Answers1

0

It is throwing the exception because when running on lower android versions it looks for the file in the drawable-v21 folder:

Those drawable folders are actually for providing device compatibility

What you should do: create btn_XXXX.xml in your drawable-21 folder or delete the folder leaving only the main drawable folder except you want do specify different drawable files based on different android versions

Tolulope
  • 488
  • 1
  • 5
  • 19