react-native-svg: Error: The file name must end with .xml or .png

Trying to build onto Android device and I get the error below. Anyone know how this can be fixed?

Execution failed for task ':app:mergeDebugResources'.
> /path/to/project/android/app/src/main/res/drawable-mdpi/app_shared_assets_icons_acknowledge.svg: Error: The file name must end with .xml or .png

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 25
  • Comments: 18

Most upvoted comments

android.disableResourceValidation=true

gradle.properties (Project Properties)

Where to set android.disableResourceValidation=true ?

Docs have been updated: https://github.com/react-native-community/react-native-svg#use-with-svg-files With react-native-svg-transformer you can now do this:

import Logo from "./logo.svg";
const MyApp = () => <Logo width={120} height={40} />
export default MyApp

Any update on this? Is android.disableResourceValidation=true the only way to solve this?

Remove the svg files from the drawable folders

After I add ‘android.disableResourceValidation=true’ to gradle.properties, I got the following warning message while syncing:

WARNING: The option setting ‘android.disableResourceValidation=true’ is experimental and unsupported. The current default is ‘false’.

I use Android Studio 3.4