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

前端 未结 6 1808
无人共我
无人共我 2020-12-15 08:40

I just updated Android Studio 1.2.1.1 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\

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-15 09:30

    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

    UPDATE: Given that this feature was fixed, you should upgrade to the latest gradle plugin release instead of reverting back.

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

    buildscript {
    
      repositories {
          jcenter()
          mavenCentral()
          // mavenLocal() // Only if you want to use your local maven repo
      }
    
      dependencies {
          // classpath 'com.android.tools.build:gradle:+'
          classpath 'com.android.tools.build:gradle:1.2.2'
      }
    }
    

提交回复
热议问题