Note that Android Studio claims to also be able to batch-import files starting version 3.4. Depending on how well that works and what you like, this solution might still be preferrable (it is for me)
We will need two tools:
-
Prior to conversion we want to optimize our .svg files using SVGO. SVG Optimizer is a Node.js-based tool for optimizing SVG vector graphics files. Find it here: https://www.npmjs.com/package/svgo
-
For conversion we will use vd-tool, a command line tool built from the actual converter inside Android Studio, so we know it will just do the same conversions. Here is a link: https://www.androiddesignpatterns.com/2018/11/android-studio-svg-to-vector-cli.html
Preconditions: I suggest setting up three folders. One for your source files, the optimized ones and then the converted files. So that after each step, you can - if necessary - verify if the files still look like they are supposed to (Since these are command line tools you won't see anything when using them so precautions like this make sense).
-
First we optimize our svgs by using
$ svgo -f SOURCE-FOLDER -o OPTIMIZED-FOLDER
-
When these look good (usually they do, don't worry), we continue by converting using vd-tool:
$ ./vd-tool -c -in OPTIMIZED-FOLDER -out CONVERTED-FOLDER.
That's it. -
Now we have converted files, we can just drag and drop them into Android Studio and in 99% of the cases there should be no rework necessary.