a-student / BetterVectorDrawable

The VectorDrawable implementation for Android 4.0+
151 stars 22 forks source link

Redefinition of attributes #11

Closed pristalovpavel closed 8 years ago

pristalovpavel commented 8 years ago

Hi!

I'm trying to load very simple vector images that was created by standalone SvgToVectorDrawableConverter and get the error:

{path_to_project}\build\intermediates\res\merged{flavor}\debug\values\values.xml Error:(302) Attribute "strokeWidth" has already been defined Error:(302) Attribute "strokeColor" has already been defined Error:(302) Attribute "fillColor" has already been defined

I've tried several images including airplane_vector.xml from demo project, but with the same result. Android Studio shows vector images in Design window without any problem.

Android Studio 1.5.1 com.android.tools.build:gradle 1.5.0 gradle 2.9 buildToolsVersion 23.0.2 com.bettervectordrawable:lib 0.7

Thanks for reply!

pristalovpavel commented 8 years ago

It seems BetterVectorDrawable conflicts with ViewPagerIndicator library with this attributes. How can I fix it?

a-student commented 8 years ago

Hi Pavel, Thank you for using BetterVectorDrawable! This happens because those attributes are defined simultaneously in both libraries. Just attach the ViewPagerIndicator library as source code (not as gradle dependency) and rename duplicate attributes.

pristalovpavel commented 8 years ago

And is it possible to add a prefix for this attributes to prevent future collisions? Maybe rename attributes to bvd_strokeWidth, bvd_strokeColor and bvd_fillColor?

a-student commented 8 years ago

I believe it is not good idea to change public API, because it would require every user of the lib to regenerate vector drawable resources. Also those attributes correspond to the system attributes in name and behavior.