MvvmCross Strange Error: Attribute "MvxBind" has already been defined
Asked Answered
A

2

6

Hey i'm a MvvmCross beginner and i try to reproduce this in my own Example-App but i got some strange build errors:

  • Error 3 Attribute "MvxBind" has already been defined
  • Error 4 Attribute "MvxLang" has already been defined
  • Error 5 Attribute "MvxTemplate" has already been defined
  • Error 6 Attribute "MvxItemTemplate" has already been defined
  • Error 7 Attribute "MvxDropDownItemTemplate" has already been defined
  • Error 8 Attribute "MvxSource" has already been defined

There is no other deifinition of these Attribute's...

This my "MvxBindingAttributes.xml":

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <declare-styleable name="MvxBinding">
    <attr name="MvxBind" format="string"/>
    <attr name="MvxLang" format="string"/>
  </declare-styleable>
  <declare-styleable name="MvxControl">
    <attr name="MvxTemplate" format="string"/>
  </declare-styleable>
  <declare-styleable name="MvxListView">
    <attr name="MvxItemTemplate" format="string"/>
    <attr name="MvxDropDownItemTemplate" format="string"/>
  </declare-styleable>
  <item type="id" name="MvxBindingTagUnique"/>
  <declare-styleable name="MvxImageView">
    <attr name="MvxSource" format="string"/>
  </declare-styleable>
</resources>

Would be cool if someone could help me :)

Or any other way/tutorial with android tabs and MvvmCross.

Alaster answered 31/7, 2015 at 10:9 Comment(3)
Are all you MvvmCross packages the same version? Also, try doing a clean build. Make sure all your Android SDK items are up-to-date.Bonefish
Hey thx for the Comment! All Cirrious.MvvmCross.Droid.XX packages are the same Runtime version (v2.0.50727) All other are (v4.0.30319)Alaster
this a problem? I have used this command to add the packages: Install-Package Cirrious.MvvmCross.Droid.Support.V4 -PreAlaster
C
11

The newer 3.5.2 and 4.0.0 packages now include MvxAttributes.xml internally. So just remove it from your own Resource\values folder.

Clockwise answered 31/7, 2015 at 13:36 Comment(2)
Hey thx for the answer, but if i remove the file there are new build-errors: Error 2 No resource identifier found for attribute 'MvxBind' in package 'TestApp.UI.Droid'Alaster
Clean your project, the Resource.Designer.cs file is most likely still looking at something old.Clockwise
A
1

You need to change the local namespace to:

xmlns:local="http://schemas.android.com/apk/res-auto"

Ajay answered 25/8, 2015 at 16:32 Comment(1)
This solved the problem for me when I had the problem a few days ago.Anting

© 2022 - 2024 — McMap. All rights reserved.