rharter / vd-tool

Android Studio's Vector Drawable conversion tool in convenient packaging.
Apache License 2.0
68 stars 8 forks source link

Compilation of latest sources fails. #1

Open inktomi opened 1 year ago

inktomi commented 1 year ago

./gradlew assembleDist fails when using the newest sources.

> Task :tools:base:vector-drawable-tool:compileJava FAILED
/Users/mruno/Projects/vd-tool/tools/base/vector-drawable-tool/src/main/java/com/android/ide/common/vectordrawable/VdCommandLineTool.java:226: error: incompatible types: Path cannot be converted to File
                String error = Svg2Vector.parseSvgToXml(inputSVGFile.toPath(), byteArrayOutStream);
                                                                           ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

This seems to be related to Google's last commit - changed Svg2Vector user to new API (commit link). I'm not sure if there's something else we need on the classpath now in order to compile vd-tool?

dqccoding commented 6 months ago

./gradlew assembleDist fails when using the newest sources.

> Task :tools:base:vector-drawable-tool:compileJava FAILED
/Users/mruno/Projects/vd-tool/tools/base/vector-drawable-tool/src/main/java/com/android/ide/common/vectordrawable/VdCommandLineTool.java:226: error: incompatible types: Path cannot be converted to File
                String error = Svg2Vector.parseSvgToXml(inputSVGFile.toPath(), byteArrayOutStream);
                                                                           ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

This seems to be related to Google's last commit - changed Svg2Vector user to new API (commit link). I'm not sure if there's something else we need on the classpath now in order to compile vd-tool?

try this: String error = Svg2Vector.parseSvgToXml(inputSVGFile.toPath().toFile(), byteArrayOutStream);

RobertoArtiles commented 4 months ago

For people trying to figure it out in 2024. The reason for this failure is an outdated android-tools dependency. Currently, the latest stable one is 31.5.1. Setting it at ./gralde/libs.versions.toml for android-tools fixes the issue and allows you to use the latest version of the tool

RobertoArtiles commented 4 months ago

./gradlew assembleDist fails when using the newest sources.

> Task :tools:base:vector-drawable-tool:compileJava FAILED
/Users/mruno/Projects/vd-tool/tools/base/vector-drawable-tool/src/main/java/com/android/ide/common/vectordrawable/VdCommandLineTool.java:226: error: incompatible types: Path cannot be converted to File
                String error = Svg2Vector.parseSvgToXml(inputSVGFile.toPath(), byteArrayOutStream);
                                                                           ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

This seems to be related to Google's last commit - changed Svg2Vector user to new API (commit link). I'm not sure if there's something else we need on the classpath now in order to compile vd-tool?

try this: String error = Svg2Vector.parseSvgToXml(inputSVGFile.toPath().toFile(), byteArrayOutStream);

This would help compile it, but you would be using an outdated version of the Android tools that produces less optimal results.