Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Conversation

@alexeystrakh
Copy link

When I'm trying to bind the material .aar library with Xamarin.Android, tooling raises an error:

../obj/Debug/android/src/com/rey/material/R.java(27,27): Error JAVAC0000:  error: variable Spinner_android_dropDownWidth is already defined in class styleable
public static final int Spinner_android_dropDownWidth = 6;

After a quick research, I figured out that the rey5137/material defines styleable attributes with reserved by Android SDK names. You can see it by hovering that attribute. And while this is just a warning in Android Studio, it's a blocker error in Xamarin.Android and I'm unable to bind this library:

Screenshot 2019-10-08 22 24 35

I'm not very familiar with styleable attributes but after some reading it seems that we want to define new attributes with unique names and move the rest into a common section to avoid duplicates. In our case, we also don't want to use reserved attributes names. The following 11 attributes were renamed to avoid that conflict:

  1. Spinner_android_dropDownWidth
  2. Spinner_android_popupBackground
  3. Spinner_android_prompt
  4. TextAppearance_android_textColor
  5. TextAppearance_android_textColorHint
  6. TextAppearance_android_textColorLink
  7. TextAppearance_android_textSize
  8. TextAppearance_android_typeface
  9. TextAppearance_android_fontFamily
  10. TextAppearance_android_textStyle
  11. TextAppearance_android_shadowColor
  12. TextAppearance_android_shadowDx
  13. TextAppearance_android_shadowDy
  14. TextAppearance_android_shadowRadius

@alexeystrakh alexeystrakh changed the title Fix Fix duplicate attributes defined in Spinner and TextAppearance attrs.xml Oct 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant