Rob Anderson Rob Anderson - 1 year ago 898
Android Question

Android: Using SVG in res leads to error: "The file name must end with .xml or .png"

I just updated Android Studio and now gradle got problems with svg in my resources folder. I was always using SVGs with no problem and I hope they will be "allowed" in the future.

:app:mergeDebugResources FAILED
Error:Error: The file name must end with .xml or .png
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg: Error: The file name must end with .xml or .png
Information:BUILD FAILED

Any ideas how to solve that ?

Answer Source

Same problem with webp files in the drawable resource directory.

The latest gradle plugin (v1.2.3) is not recognizing some of the image formats that used to work before. I don't have the issue when I switch back to v1.2.2

You can change the version in your build.gradle by setting:

buildscript {

  repositories {
      // mavenLocal() // Only if you want to use your local maven repo

  dependencies {
      // classpath ''
      classpath ''
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download