Support v4 > 20.0.0.4 TypeForwarding

codewispcodewisp USMember ✭✭

Hi all,

I updated my dependencies today to 22.2.0.0 and I got conflicts when building my project that has Support v7 CardView.
It was giving me errors similar to:
Attribute 'cardBackgroundColor' is already defined.

I was able to trace it to the support v4 library as it was pointing to that folder in obj\resourcecache\XXXXXXXXXX
Question 1) Why does the support v4 values.xml contain references to CardView?

I tried creating a new project, and the moment I performed:
Install-Package Xamarin.Android.Support.V4

The first thing I noticed was that it did not download the V13 support library anymore (20.0.0.4 does this).
Question 2) Is the TypeForwarding fix (to allow both V4 and V13 libraries to be referenced) not available anymore?

At the moment I am downgrading all my libraries back to 20.0.0.4. Has anyone encountered this?

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    Try removing all the Support packages, and re-add them.

  • codewispcodewisp USMember ✭✭

    @Cheesebaron , I already tried that, to no avail.

    Installing Support v4 > 20.0.0.4 does not perform the same actions as installing Support v4 20.0.0.4 which installs Support v13 as well and points the project to the TypeForwarded v4 .dll.

  • CheesebaronCheesebaron DKInsider, University mod

    What version of Xamarin.Android are you running?

  • codewispcodewisp USMember ✭✭

    Xamarin.Android
    Version: 5.1.3 (Business Edition)

    Here is what I want to happen:

    • I want to use an updated Support v4 and v13 library (22.2.0.0)
    • I want to use an updated Support v7 AppCompat (22.2.0.0)
    • I want to use latest Support v7 CardView (22.2.0.0)

    If I create a new project and add these libraries, build will fail. I get a lot of the following errors:
    Error 2 error: package android.support.v7.app.ActionBar does not exist
    android.support.v7.app.ActionBar.OnMenuVisibilityListener

    Error 3 error: package android.support.v7.app.ActionBar does not exist
    android.support.v7.app.ActionBar.OnNavigationListener

    Error 4 error: package android.support.v7.app.ActionBar does not exist
    android.support.v7.app.ActionBar.TabListener

    In my existing project which was building fine, I went ahead and updated all the support libraries. I got the same errors. The first errors were saying there are an ambiguous references between several classes from v4 and v7 (for example AlertDialog). Once I fixed those errors, I got the compilation errors above.

    Once I downgraded Support v7 AppCompat to 21.0.3.0, CardView, the errors above disappeared, but the "Attribute card******* is already defined." errors started coming out.

    All I want to do is to use the following:

    • Latest Support v4 and v13
    • Latest Support v7 CardView
    • Latest GooglePlayServices (which depends on Support v7 AppCompat)
  • CheesebaronCheesebaron DKInsider, University mod

    What is the reason to use both V13 and V4? Can't you suffice with V4?

  • codewispcodewisp USMember ✭✭

    @Cheesebaron yeah turns out I don't need v13 anymore. I needed it previously as a library I don't use anymore had a reference to it. I was able to remove it from my solution.

    My issue still stands regarding v7, though.

    I have the latest support v4 22.2.0.0, and support v7 appcompat 22.2.0.0, and I am getting these compile errors. I get the same when adding v4 and v7 to a blank project.

  • abdulraufraufiabdulraufraufi PKMember ✭✭
    edited December 2015

    hy.....i have a problem in supporting library v4..errors contents does not exist?how we resolve

  • annezaoannezao BRMember

    Not work yet, same problem here.
    "No resource identifier found for attribute 'cardBackgroundColor' in package com.[name of package]"

Sign In or Register to comment.