New Xamarin form project have packages conflicting and cant compile. How can I fix it?

eduardocamposeduardocampos CRMember ✭✭
edited February 14 in Xamarin.Forms

Each time I try to create a new xamarin forms project, errors like this appears.

Error NU1202 El paquete Xamarin.Android.Support.v7.CardView 25.4.0.2 no es compatible con monoandroid60 (MonoAndroid,Version=v6.0). El paquete Xamarin.Android.Support.v7.CardView 25.4.0.2 admite: monoandroid70 (MonoAndroid,Version=v7.0)

I have googled a lot and I have no idea of how to fix it, I havent done anything, this just doesnt allow me to compile the project.
So, what am I supposed to do?

Visual studio 2017 is updated to the latest version btw.

Posts

  • Xami3Xami3 PKMember ✭✭✭

    is your Android SDK upto date? plus have you restore the nuget packages?

    if yes, can you please clean/rebuild the project?

  • CharwakaCharwaka INMember ✭✭✭✭
    edited February 14

    @Xami3 said:
    is your Android SDK upto date? plus have you restore the nuget packages?

    if yes, can you please clean/rebuild the project?

    @eduardocampos

    make sure you have done the above ,if still don,t work try downgrading lower versions like

    Xamarin.Android.Support.v7.CardView 23.3.0 or 24

    ad also try setting below in CSproj ,and make sure you installed Android SDK what ever your configure Here

    <TargetFrameworkVersion>v5.0</TargetFrameworkVersion>

  • eduardocamposeduardocampos CRMember ✭✭

    the android is now up to date, and I clicked the restore nuget packages.
    and I rebuilt and cleaned it.

    Also, I cant downgrade the nuget packages, it just doesnt work, I assume is because it depends of another packages or something like that.

    Another problem is that it tells me that it needs an asembly reference but I have no idea of where I can get that assembly reference. Here is the error

    Error CS0012 El tipo 'AppCompatActivity' está definido en un ensamblado al que no se hace referencia. Debe agregar una referencia al ensamblado 'Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. MyBooks.Android C:\Users\EdoAn\OneDrive\Documentos\Visual Studio 2017\Projects\MyBooks\MyBooks\MyBooks.Android\MainActivity.cs

    I also went to myProject.android.csproj and added it there by doing , and still doesnt work.

    Also, this only happens on xamarin.forms projects, on normal android projects (using xamarin) it compiles fine.

  • eduardocamposeduardocampos CRMember ✭✭

    I kind of fixed it. My phone is android 6, so I set everything on the project to target that version of android. On the android manifest there is no reference to 7.0.

    But for some reason, xamarin forms needs android sdk 7.0 to be installed.
    Now it worked.

  • shamseenshamseen Member ✭✭

    @eduardocampos said:
    I kind of fixed it. My phone is android 6, so I set everything on the project to target that version of android. On the android manifest there is no reference to 7.0.

    But for some reason, xamarin forms needs android sdk 7.0 to be installed.
    Now it worked.

    oh man, really?

    i'm just building a small app for API 19-22 because i'm bored so i didn't want sdk7. but it seems to have gotten rid of all the errors

Sign In or Register to comment.