简体   繁体   中英

Xamarin Android Error

Whenever I try to use NewtonSoft.Json in my Xamarin Forms Android project it prints out the following error

1>No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=snip" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=snip". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=snip" arbitrarily. 1>Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>The $(TargetFrameworkVersion) for FormsViewGroup.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project. 1>The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project. 1>The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (vv8.0) is greater than the $(TargetFrameworkVersion) for your project (v7.1). You need to increase the $(TargetFrameworkVersion) for your project. 1>Done building project "SocialNetwork.Android.csproj".

I tried looking in the project .Android (Android Properties) for something that says 7.1 to update to 8.0 since I'm guessing that's what the log is trying to say

But in the application tab the option for "Compile using Android Version (Target Framework)" only has an option for 7.1

Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved.

I think this error occurred because Projects in your Solution includes different versions of Newtonsoft.Json dll. if the problem case by that best thing to do is uninstall Newtonsoft.Json from both xamarin.android and xamarin.forms project and install again with newer version. if your solution have other platform project their Newtonsoft.Json dll also should uninstall.

And also update your xamarin.Forms dll to the latest version.

"But in the application tab the option for "Compile using Android Version (Target Framework)" only has an option for 7.1"

Install Latest SDK platform "API 26" from SDK Manager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM