AppCompat v7 21.0.00-beta1 + GooglePlayServices "attribute 'theme' has already been defined"

Hi guys,
I'm trying to use the AppCompat to use MaterialDesign, but when i'm trying to compile the project, i'm getting this error.

Anyone have this problem too?

Posts

  • DalmasDalmas FRMember ✭✭
    edited November 2014

    I have the same issue, it seems to be a bug with the Xamarin google play services binding library when used with AppCompat 21.

    It's annoying that we are still not able to use this library. It has been a month now and nothing has changed. When will it get updated? I don't see the point of binding all of the new android 5.0 APIs on day one, while leaving such bugs in the support libraries (which is what developers will actually use).

  • JeremyKolbJeremyKolb USMember ✭✭✭

    Agreed. I'm surprised that they haven't released a new version.

  • AlbertoEstrellaAlbertoEstrella DOMember ✭✭

    Wow! There is no news about this? I'm having the same issue! :(

  • KarlKoppKarlKopp AUMember ✭✭

    Bugger, having same problem and looks like there is no answer... Rolling back 4 hours of work :/

  • xtiancapilxtiancapil USMember

    The Xamarin binding for Google Play Services hasn't been updated to the latest version (21.0) to fix the attribute name changes. If you can, wait until Xamarin updates the bindings (which I hope would coincide with the official release of AppCompat v7 r21).

    BUT if you must, you can do what I did and just remove the files. If you build your project, you'll get the error 'attritbute theme has already been defined'. Below are the list of files I deleted to get my app to compile:

    <your-project-directory>\packages\Xamarin.GooglePlayServices.19.0.0.1\lib\MonoAndroid23\19\content\google-play-services\libproject\google-play-services_lib\res\values\wallet_attrs.xml
    <your-project-directory>\packages\Xamarin.GooglePlayServices.19.0.0.1\lib\MonoAndroid23\19\content\google-play-services\libproject\google-play-services_lib\res\values\wallet_styles.xml
    

    Again, this is a HACK. The proper way to fix this would be to bind the latest version and use that but I don't have the time (nor the skills) to do it in the timeframe that I need.

    Hope this helps.

  • leobragattileobragatti BRMember ✭✭

    Looks like it comes out of beta. Anyone already try to update and see if it's working?

    https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/

  • I've already rolled out to AppCompat v21 just fine, but I'm using Google Play Services Froyo.

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    @leobragatti do you have a reproducible sample? We have published 21.0.3 to nuget and the component store already.

  • leobragattileobragatti BRMember ✭✭

    @Redth‌, not yet. I will test this new version and publish any news here.

  • JohnBotibolJohnBotibol GBMember ✭✭

    Hi Guys

    I too have this problem since updating my components. I am using:

    Xamarin Google Play 19.0.0.2
    Xamarin AppCompat 21.0.3.0
    Xamarin V4 Support 21.0.3.0

    Visual Studio 2013

    I have removed the components, deleted the local cache and re-installed but no joy.

    I deleted the file wallet_attrs.xml but that did not work either.

    I have reported this to Xamarin support and received a completely unsatisfactory response (given I have a Professional subscription).

    I am becoming very, very wary of updating anything Xamarin. This is the second major, show stopping issue I have had within the last 3 months.

    I can no longer build the Android version of my app.

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    Can someone post a reproducible project of this issue?

    Also, be sure your Target SDK Version is set to API Level 21. You can still set your Target Framework to something else, but Target SDK Version MUST BE 21 or higher if you are using AppCompat v7.

  • JohnBotibolJohnBotibol GBMember ✭✭
    edited December 2014

    Google play services component 22.0.0.0 (appeared today) seems to have fixed it. App is now building fine.

  • leobragattileobragatti BRMember ✭✭
    edited December 2014

    @Redth‌, I'm using the following packages on my project:
    <br /> Xamarin.Android.Support.v13 version="20.0.0.4"<br /> Xamarin.Android.Support.v4 version="20.0.0.4"<br /> Xamarin.Android.Support.v7.AppCompat version="20.0.0.2"<br /> Xamarin.Android.Support.v7.MediaRouter version="20.0.0.1"<br /> Xamarin.GooglePlayServices" version="19.0.0.1<br />

    After updating to the latest version, Xamarin removed package Xamarin.Android.Support.v13 from packages and now i've got the following errors:

    Error XA5209: Unzipping failed. Please download https://dl-ssl.google.com/android/repository/android_m2repository_r10.zip and extract it to the /Users/tegris/.local/share/Xamarin/Android.Support.v7.MediaRouter/21.0.3/content directory. (XA5209)

    Error XA5207: Please install package: 'Android Support Library MediaRouter' available in SDK installer. Java library file /Users/tegris/.local/share/Xamarin/Android.Support.v7.MediaRouter/21.0.3/embedded/classes.jar doesn't exist. (XA5207)

  • JonathanDickJonathanDick CAXamarin Team, Developer Group Leader Xamurai

    @leobragatti you can try deleting some of the cached Android.Support.* directories under ~/.local/share/Xamarin/
    Then, make sure you delete the bin/ and obj/ folders of all projects in your solution, restart Xamarin Studio just to be safe, and rebuild.

  • leobragattileobragatti BRMember ✭✭

    @Redth‌ , I did what you suggest and it works like a charm. Thanks!!

Sign In or Register to comment.