AndroidSupportComponents icon indicating copy to clipboard operation
AndroidSupportComponents copied to clipboard

Xamarin.Android.Support.v7.AppCompat v27.xxxxx will not install or update

Open OladotunO opened this issue 8 years ago • 23 comments

Hi Guys

I have been struggling to instal Xamarin.Android.Support.v7.AppCompat v27.xx on a blank android project in Visual studio 2017 via the nuget package installer. Afterall, I had done so only a few days ago and on many other projects.

So I gave up, and looked at the other projects, then tried to update them, and they fail to update. V26.1.0.1 installs and is the last working one for me.

Is this a bug or has something changed ?

Cheers

OladotunO avatar Mar 07 '18 11:03 OladotunO

The last update screw ups my project too, I need to install a package which has a dependency with Xamarin.Android.Support.v7.AppCompat and it's failing because of this:

Could not install package 'Xamarin.Android.Support.Design 27.0.2'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v8.0'

victorgilalejandria avatar Mar 07 '18 13:03 victorgilalejandria

Same here Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)

I manually ran Visual Studio Installer and there is an update. Perhaps that will fix this problem.

NoleHealth avatar Mar 07 '18 14:03 NoleHealth

Yeah, you have to manually update VS and then change the Target Framework to Oreo 8.1. In my case set it to automatically the latest didn't work.

victorgilalejandria avatar Mar 07 '18 14:03 victorgilalejandria

I just wasted a whole day trying to update Xamarin packages from v25 to v27.

I started with a well working project in VS 2017 v15.5.6. Trying to upgrade packages to v27 resulted in the above error message ("... is not compatible with monoandroid80") over upgrading VS to 15.6.1, which resulted in problems during app start (app appears and disappears without errors), "cannot connect to logcat" errors, killing and restarting the adb server, rebooting, installing/removing android SDKs, build tools, uninstalling the app from the phone and wtfever I cannot even remember all the things I tried today. The last thing I did before the app finally started again was disabling parallel builds!

At the end of that day I seem to be able to start the app again but I have no idea what I did wrong at the beginning, nor what I did to make it work again. Sorry for that lousy error report.

stmax82 avatar Mar 12 '18 16:03 stmax82

I have the same problem here.

Could not install package 'Xamarin.Android.Support.Animated.Vector.Drawable 27.0.2'. You are trying to install this package in a project that is intended for 'MonoAndroid, Version = v8.0', but the package does not contain any assembly or content reference that is compatible with this framework. For more information, please contact the package author.

Has anyone managed to solve the problem?

matmiranda avatar Mar 22 '18 01:03 matmiranda

Having the same problem, cannot install and update half of packages that I needed.

VladimirCourse avatar Mar 22 '18 07:03 VladimirCourse

Everyone has this problem, the author should fix this problem as soon as possible.

matmiranda avatar Mar 22 '18 13:03 matmiranda

@NoleHealth and matmiranda. According to your error message you are trying to install support components with a higher version (api 27) then your targer framework (api 26). That is not possible. You first need to set your target framework to api 27 aka Android 8.1 Oreo before you can update the support components to api 27. See this channel 9 episode where its is explained in more detail: https://channel9.msdn.com/Shows/XamarinShow/Snack-Pack-14-Upgrading-Android-Support-Libraries Or did you do that? If you did and receive this error then it might be bug.

michelmoorlag avatar Mar 26 '18 11:03 michelmoorlag

@michelmoorlag Huge confusion point cleared up. Thanks.

matmiranda avatar Mar 26 '18 17:03 matmiranda

Good video. I'll try that with the next update. I think for me (being new to Xamarin) the error message was quite confusing:

"Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with monoandroid80"

I didn't see the link between "... isn't compatible with monoandroid80" and upgrading to API 27, so ended up upgrading VS and trying other stupid things. Maybe the error message could be improved...

stmax82 avatar Mar 26 '18 17:03 stmax82

I've got the same issue. I am using MonoAndroid v8.1 with target API 27. The reason is that linked dependencies are requiring MonoAndroid v8.0. The full chain of dependencies (with monoandroid version in brackets) Xamarin.Android.Support.v7.AppCompat 27.0.2 (monoandorid81)->Xamarin.Android.Support.Compat 27.0.2(monoandorid81)->Xamarin.Android.Arch.Lifecycle.Runtime 1.0.3(monoandroid80 - here starts failure)->Xamarin.Android.Arch.Lifecycle.Common 1.0.3(monoandroid80)

aleksvu avatar Mar 27 '18 10:03 aleksvu

You'll need to have your project set to use <TargetFramework>MonoAndroid81</TargetFramework> which means you'll need Xamarin 15.6 at least installed to use v27.x of android support libraries.

The linked dependencies requiring MonoAndroid 8.0 is something we'll be fixing in the 27.1.0 release, however this should not prevent you from installing this still, though if you're using to specify nuget packages, you may need to explicitly list all of the dependencies in your project file (this is due to resolution failing fast by design with PackageReference, as opposed to the old packages.config style).

We're working on 27.1.0 release which will update the Arch dependencies to 1.1.1 as well, and those will target MonoAndroid81 which hopefully makes things work without being so explicit in your PackageReference listings.

Redth avatar Mar 27 '18 13:03 Redth

Well its working now, what did was 1,Install Android sdk 27.xx and sdk P(Probably unnecessary) 2,Upgraded VS to 15.6.3 3, selected Android 8.1 in project properties for compile using(application tab) target android version(android manifest tab)

I had done the above before, but may have missed out step 3, not sure, but it failed then. Now it works.

Thanks all

OladotunO avatar Mar 27 '18 20:03 OladotunO

This setting was missing for me in csproj:

<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>

adding it fixed it for me.

<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>

alone was not enough, NuGet still thought I use 'MonoAndroid,Version=v8.0'

MagicAndre1981 avatar Apr 19 '18 06:04 MagicAndre1981

@michelmoorlag thank you! the video helped me sort it out.

jccalbuquerque avatar Apr 25 '18 12:04 jccalbuquerque

For me, it was because I couldn't install 8.1. Visual studio update was necessary. See this: https://blog.xamarin.com/xamarin-android-now-double-stuffed-with-oreo-8-1/

baneageorge avatar May 14 '18 21:05 baneageorge

Even though I had set everything to 8.1, I had to go into the .csproj and update TargetFrameworkVersion to 8.1, it still said 8.0. Maybe there is another place I was supposed to set this but editing it manually allowed me to upgrade. <TargetFrameworkVersion>v8.1</TargetFrameworkVersion>

jjtx333 avatar May 18 '18 04:05 jjtx333

The old "You must explicitly select the Target framework" bug is back. You can change the value in the application settings by explicitly setting the value, rather than selecting "Use latest platform".

lhughey avatar May 28 '18 16:05 lhughey

@lhughey that's the answer!

justintemplar avatar May 30 '18 02:05 justintemplar

In my case. I have used a Nuget package Geolocator and which is not updated to the latest whereas Support Nuget is updated. So after updating the Geolocator nuget issue resolved

divyeshg94 avatar Mar 29 '19 08:03 divyeshg94