I upgraded my Visual Studio version to 15.5.2 last night. Now I can no longer run Xamarin.Forms cross platform apps. They were working fine with no errors before.
When I create a project the option for .NET Portable Class Library is no longer available, and has been replaced with the .NET standard library option.
However the template project that visual studio creates doesn't work. It gives me all these errors. I don't know what to do to fix this, I tried installing the latest .NET Core SDK based on this answer
https://stackoverflow.com/a/45737766
but it had no effect.
1.
Severity Code Description Project File Line Suppression State Error The current .NET SDK does not support targeting .NET Standard 2.0. Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0. Phoneword C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.TargetFrameworkInference.targets 126
2.
Severity Code Description Project File Line Suppression State Error The "ResolveLibraryProjectImports" task failed unexpectedly. System.IO.FileNotFoundException: Could not load assembly 'Phoneword, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? File name: 'Phoneword.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection1 jars, ICollection
1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection
1 resolvedEnvironments) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Phoneword.Android
.
EDIT: The following 4 errors (3 - 7) went away after I installed the Android 8 SDK from the Android SDK manager, then selected it in the 'Compile using Adnroid Version' option'
3.
Error NU1202 Package Xamarin.Android.Support.v4 25.4.0.2 is not compatible with monoandroid60 (MonoAndroid,Version=v6.0). Package Xamarin.Android.Support.v4 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0)
4.
Error NU1202 Package Xamarin.Android.Support.v7.CardView 25.4.0.2 is not compatible with monoandroid60 (MonoAndroid,Version=v6.0). Package Xamarin.Android.Support.v7.CardView 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0)
5.
Error NU1202 Package Xamarin.Android.Support.v7.AppCompat 25.4.0.2 is not compatible with monoandroid60 (MonoAndroid,Version=v6.0). Package Xamarin.Android.Support.v7.AppCompat 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0)
6.
Error NU1202 Package Xamarin.Android.Support.v7.MediaRouter 25.4.0.2 is not compatible with monoandroid60 (MonoAndroid,Version=v6.0). Package Xamarin.Android.Support.v7.MediaRouter 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0)
7.
Error NU1202 Package Xamarin.Android.Support.Design 25.4.0.2 is not compatible with monoandroid60 (MonoAndroid,Version=v6.0). Package Xamarin.Android.Support.Design 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0)
Phoneword
. Rundotnet --version
to see what exactly is the .NET Core SDK on your machine. I cannot reproduce the error at all (but another related to Xamarin.Android). – Lex Liglobal.json
left somewhere by mistake. If such a file exists and forces its sub directories to use the out-of-date SDK version, no doubt you won't get things done. – Lex Li