1

I have my SVG icon in the drawable folder, but I keep getting the resource not found exception. Here's the full log message, I appreciate your help.

Process: com.audioplayer.mp3player.sandy.app, PID: 15875 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.audioplayer.mp3player.sandy.app/com.audioplayer.mp3player.sandy.app.Activity.HomeActivity}: android.view.InflateException: Binary XML file line #208: Binary XML file line #208: Error inflating class ImageButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) at android.app.ActivityThread.access$1100(ActivityThread.java:222) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #208: Binary XML file line #208: Error inflating class ImageButton at android.view.LayoutInflater.inflate(LayoutInflater.java:551) at android.view.LayoutInflater.inflate(LayoutInflater.java:429) at android.view.LayoutInflater.inflate(LayoutInflater.java:380) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_plus_library.xml from drawable resource ID #0x7f0800fe at android.content.res.Resources.loadDrawableForCookie(Resources.java:4220) at android.content.res.Resources.loadDrawable(Resources.java:4089) at android.content.res.Resources.loadDrawable(Resources.java:3939) at android.content.res.TypedArray.getDrawable(TypedArray.java:886)

Ab Morphious
  • 204
  • 1
  • 10
  • "I have my SVG icon in the drawable folder" -- do you literally mean an SVG file? If so, that is not a valid resource format. You can use the Vector Asset wizard in Android Studio to convert some SVG files to vector drawables, though. – CommonsWare May 23 '20 at 11:40
  • @CommonsWare I have used the Vector Asset wizard to convert them into vector drawables for all of my icons in my project. I get this error specific to 'ic_plus_library.xml' file. – Ab Morphious May 23 '20 at 11:55

1 Answers1

0

if answers given in Android resource not found exception did not worked for you, check your xml file with your vector code.

I experienced this error because I wanted to put a vector without a path, just to fill a raw, found out this was a bad idea...

tho mas
  • 11