Error using Google Play Services and the support library

ClockAppDevClockAppDev NLMember ✭✭

I am currently using Google Play Services and several components of the support library in my project.

The project.json file looks like this:

{
"dependencies": {
"Xamarin.Android.Support.Design": "25.4.0.1",
"Xamarin.Android.Support.v7.CardView": "25.4.0.1",
"Xamarin.Android.Support.v7.GridLayout": "25.4.0.1",
"Xamarin.Android.Support.v7.RecyclerView": "25.4.0.1",
"Xamarin.Android.Support.Percent": "25.4.0.1",
"Xamarin.Android.Support.Animated.Vector.Drawable": "25.4.0.1",
"Xamarin.Android.Support.v14.Preference": "25.4.0.1",
"Xamarin.Android.Support.Vector.Drawable": "25.4.0.1",
"Xamarin.GooglePlayServices.Analytics": "42.1021.1",
"Xamarin.GooglePlayServices.Location": "42.1021.1",
"Xamarin.GooglePlayServices.Maps": "42.1021.1"
},
"frameworks": {
"MonoAndroid,Version=7.1": {}
}
}

However, whenever I build this project I get the following error.

Error NU1607 Version conflict detected for Xamarin.Android.Support.Compat. Reference the package directly from the project to resolve this issue. MyApp.Android (>= 1.0.0) -> Xamarin.Android.Support.Vector.Drawable (>= 25.4.0.1) -> Xamarin.Android.Support.Compat (>= 25.4.0.1) MyApp.Android (>= 1.0.0) -> Xamarin.GooglePlayServices.Analytics (>= 42.1021.1) -> Xamarin.GooglePlayServices.Basement (>= 42.1021.1) -> Xamarin.Android.Support.v4 (>= 25.1.0) -> Xamarin.Android.Support.Compat (>= 25.1.0).

This issue doesn't occur when only the support libraries or only the google play libraries are added. It only occurs when both are added to the project.
The error seems strange as well considering the conflicting library (Xamarin.Android.Support.Compat version 25.4.0.1) satisfies both the Xamarin.Android.Support.Compat (>= 25.1.0) and the Xamarin.Android.Support.Compat (>= 25.4.0.1) constraint.

Answers

  • tuyenvtuyenv VNUniversity ✭✭✭

    Plz try to downgrade to v25.3.1.

    v25.4.0.1 isn't stable, contains a lot of bugs.

    Cheers.

  • ThomasHagstrmThomasHagstrm SEMember ✭✭
    edited October 31

    @tuyenv said:
    Plz try to downgrade to v25.3.1.

    v25.4.0.1 isn't stable, contains a lot of bugs.

    Cheers.

    I'm doing exactly that - using Android.Support 25.3.1 with Xamarin.GooglePlayServices 42.1021.1.
    Even with multidex on it crashes with the following error:

    System.TypeLoadException: Could not resolve type with token 0100005a (from typeref, class/assembly Android.Gms.Gcm.Iid.InstanceID, Xamarin.GooglePlayServices.Gcm

  • tuyenvtuyenv VNUniversity ✭✭✭

    @ThomasHagstrm,

    Latest version of Xamarin Android Support libraries are ok to use by now :). Plz check it out if your issue is fixed.

    Cheers.

  • ThomasHagstrmThomasHagstrm SEMember ✭✭

    @tuyenv cool, I'll check it out. only affects what SDKs are required on machine, right, not Android version on device (as that is controlled by Minimum version)?

  • tuyenvtuyenv VNUniversity ✭✭✭

    That's right! @ThomasHagstrm

Sign In or Register to comment.