Xamarin.Android.Support issue - xamarin

Warning NU1608 Detected package version outside of dependency constraint: Xamarin.Android.Support.Fragment 27.0.2.1 requires Xamarin.Android.Support.Compat (= 27.0.2.1) but version Xamarin.Android.Support.Compat 28.0.0.3 was resolved.
All I did was to install Xamarin.Android.Support.Compat. I didn't specify any particular version. I don't see anything with the name Support.Fragment.
Not sure what to do.

Related

Error NU1107 Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData

I get the following error:
Error NU1107 Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData.
Install/reference Xamarin.AndroidX.Lifecycle.LiveData 2.4.1.1 directly to project MyProject.Android to resolve this issue.
MyProject.Android -> Xamarin.GooglePlayServices.Ads 121.2.0 -> Xamarin.GooglePlayServices.Ads.Lite 121.2.0 ->
Xamarin.AndroidX.Work.Runtime 2.7.1.3 ->
Xamarin.AndroidX.Lifecycle.LiveData (>= 2.4.1.1)
MyProject.Android -> Xamarin.Forms 5.0.0.2515 -> Xamarin.AndroidX.Lifecycle.LiveData (>= 2.3.1.1 && < 2.4.0).
Which packages should I upgrade or downgrade in order to achieve compatibility?
I have created a new project to test the packages you mentioned. And I found two solutions:
Just use the following package in your project's android part:
Xamarin.AndroidX.Browser version 1.4.0.1
Xamarin.AndroidX.Lifecycle.LiveData version 2.4.1.1
Xamarin.GooglePlayServices.Ads version 121.2.0
Xamarin.Forms version 5.0.0.2515
This solution just adds the reference to the project's android part according to the error messages. And the project will build successfully even though there are still some warnings about the package.
The second solution:
use the Xamarin.Forms version 5.0.0.2545
and the Xamarin.GooglePlayServices.Ads version 120.4.0
The Xamarin.GooglePlayServices.Ads version 120.4.0 is the newest version which is compatible with the Xamarin.AndroidX.Browser (>= 1.3.0.6 && < 1.4.0). If you use the two packages above, there will not be any warnings or errors about the reference.
If you can, you should upgrade to Xamarin.Forms 5.0.0.2545. It allows for LiveData to be high enough. It's a minor upgrade for XF, so it shouldn't cause you any issues to upgrade.
If for whatever reason you can't upgrade Xamarin Forms, you'll need to downgrade GooglePlayServices.Ads to a version that allows for the lower Work.Runtime version which in turn allows for the lower LiveData version.

How to fix NuGet error Version conflict detected for Stimulsoft.Reports.Engine.NetCore

Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Stimulsoft.Reports.Engine.NetCore. Install/reference Stimulsoft.Reports.Engine.NetCore 2020.2.3 directly to project QRADARV12.Stimulsoft to resolve this issue.
QRADARV12.Stimulsoft -> Stimulsoft.Dashboards.Web.NetCore 2020.2.3 -> Stimulsoft.Reports.Engine.NetCore (= 2020.2.3)
QRADARV12.Stimulsoft -> Stimulsoft.Reports.Web.NetCore 2019.3.4 -> Stimulsoft.Reports.Engine.NetCore (= 2019.3.4). QRADARV12.Stimulsoft D:\Q-RADARV12\General Version\UI\QRADARV12.Stimulsoft\QRADARV12.Stimulsoft.csproj 1
I keep getting this issue over and over, and i have no idea on how to fix this already.
How to fix NuGet error Version conflict detected for
Stimulsoft.Reports.Engine.NetCore
I think you have installed one of Stimulsoft.Reports.Web.NetCore 2019.3.4 and timulsoft.Dashboards.Web.NetCore 2020.2.3 nuget packages, then install the other and face the issue.
I have tested in my side and get the same error message:
The main reason is that they two nuget packages both have a dependency called Stimulsoft.Reports.Engine.NetCore.
Stimulsoft.Reports.Web.NetCore 2019.3.4 has the dependency Stimulsoft.Reports.Engine.NetCore 2019.3.4
while
timulsoft.Dashboards.Web.NetCore 2020.2.3 has the dependency Stimulsoft.Reports.Engine.NetCore 2020.2.3.
Different nuget packages all point to this dependency but different versions of the dependencies cause different versions of the dependencies, causing conflicts.
Solution
You should make sure that the two main nuget packages have the same version.
----------
1) If you first installed Stimulsoft.Reports.Web.NetCore 2019.3.4, you should installed timulsoft.Dashboards.Web.NetCore 2019.3.4
Or
update Stimulsoft.Reports.Web.NetCore 2019.3.4 to 2020.2.3 and then installed timulsoft.Dashboards.Web.NetCore 2020.2.3
----------
2) If you installed timulsoft.Dashboards.Web.NetCore 2020.2.3 first, you should then
installed Stimulsoft.Reports.Web.NetCore 2020.2.3.

Xamarin MSAL NuGet error - Version conflict detected for Xamarin.Android.Support.Compat

I'm trying to add the MSAL NuGet package https://www.nuget.org/packages/Microsoft.Identity.Client to a Xamarin forms project but keep getting the following error:
Package restore failed. Rolling back package changes for
'MobileApp.Android'.
Error NU1107 Version conflict detected for
Xamarin.Android.Support.Compat. Install/reference
Xamarin.Android.Support.Compat 27.0.2.1 directly to project
MobileApp.Android to resolve this issue.
MobileApp.Android -> Xamarin.Android.Support.v7.MediaRouter
27.0.2.1 -> Xamarin.Android.Support.v7.Palette 27.0.2.1 ->
Xamarin.Android.Support.Compat (= 27.0.2.1)
MobileApp.Android -> Microsoft.Identity.Client 2.2.0-preview ->
Xamarin.Android.Support.CustomTabs 27.0.2 -> Xamarin.Android.Support.Compat
(= 27.0.2).
I've tried clearing the NuGet cache from Visual Studio 2017 -> Tools -> Options -> NuGet Package Manager, and also manually clearing the cache by deleting the contents of the following folders:
%userprofile%\.nuget\packages
%localappdata%\NuGet\v3-cache
%temp%\NuGetScratch
%localappdata%\NuGet\plugins-cache
I've also tried creating a new blank project and just adding the NuGet package but continue to receive the same error. NuGet seems to working OK for other types of projects.
Any ideas much appreciated.
Xamarin MSAL NuGet error - Version conflict detected for Xamarin.Android.Support.Compat
This is nuget package version conflict issue.
To resolve this issue, you should install the package Xamarin.Android.Support.CustomTabs 27.0.2.1 at first, then install the package Microsoft.Identity.Client.
The reason for this issue:
Since you have already installed the package Xamarin.Android.Support.v7.MediaRouter
27.0.2.1 in your project, which have a indirect dependence Xamarin.Android.Support.Compat (= 27.0.2.1). When you install the package Microsoft.Identity.Client to the project, which also have a indirect dependence Xamarin.Android.Support.Compat (= 27.0.2). You could notice that the versions are different, a project cannot reference the same reference different version, which cause the version conflict.
To resolve this issue, we need to unify the references of these two different versions. Check the Dependencies of the package Microsoft.Identity.Client 2.2.0-preview, this package have a dependency Xamarin.Android.Support.CustomTabs (>= 27.0.2) and the dependency Xamarin.Android.Support.CustomTabs (>= 27.0.2) also have a dependency Xamarin.Android.Support.Compat (= 27.0.2). So to resolve this issue, we just need to install the dependency Xamarin.Android.Support.CustomTabs (>= 27.0.2.1) at first, which have the dependency is Xamarin.Android.Support.Compat (= 27.0.2.1):
Hope this helps.

Is there an OData dependency graph somewhere?

I'm following this guide to migrate an app I developed to an open framework. I get to the part where I'm supposed to install all the OData references. Specifically these:
Install-Package Angularjs
Install-Package Microsoft.OData.Client
Install-Package Microsoft.OData.Core
Install-Package Microsoft.OData.Edm
Install-Package Microsoft.Spatial
Install-Package Microsoft.AspNet.OData
Install-Package Microsoft.AspNet.WebApi.WebHost
And these are the errors I get:
Unable to resolve dependencies. 'Microsoft.OData.Core 7.0.0' is not compatible with 'Microsoft.OData.Client 6.15.0 constraint: Microsoft.OData.Core (= 6.15.0)'.
Unable to find a version of 'Microsoft.OData.Core' that is compatible with 'Microsoft.OData.Client 6.15.0 constraint: Microsoft.OData.Core (= 6.15.0)'.
Unable to find a version of 'Microsoft.OData.Core' that is compatible with 'Microsoft.OData.Client 6.15.0 constraint: Microsoft.OData.Core (= 6.15.0)'.
Unable to find a version of 'Microsoft.OData.Edm' that is compatible with 'Microsoft.OData.Core 6.15.0 constraint: Microsoft.OData.Edm (= 6.15.0)'.
I started running my app over and over until it throws an exception and then adding a bingindRedirect to my Web.config to target the currently installed versions. But this doesn't seem right and will add a lot of maintenance later on. I know how to install old versions and nightly versions. But I have no idea which versions to install. Is there some place that tells me which versions work together correctly?
According to NuGet, I have version 6.15.0 of each installed. So why am I getting errors?
Microsoft.OData.Core, Microsoft.OData.Edm and Microsoft.Spatial were already installed after you run "Install-Package Microsoft.OData.Client" command since they are all the dependencies. You can check it from your project reference. So you don't need these commands anymore:
Install-Package Microsoft.OData.Core
Install-Package Microsoft.OData.Edm
Install-Package Microsoft.Spatial
And since the latest version of Microsoft.OData.Client is 6.15.0 which required Microsoft.OData.Core with version 6.15.0. All these packages are installed with version 6.15.0.
If you run the commands below:
Install-Package Microsoft.OData.Core -Version 6.15.0
Install-Package Microsoft.OData.Edm -Version 6.15.0
Install-Package Microsoft.Spatial -Version 6.15.0
You will get the message like following:
Package 'Microsoft.OData.Core.6.15.0' already exists in project
Another issue is that the latest 6.0.0 version of Microsoft.AspNet.OData requires Microsoft.OData.Core version >= 7.0.0 while the version you already installed is 6.15.0. So you need to install the 5.9.1 version which requires Microsoft.OData.Core > 6.14.0.
Install-Package Microsoft.AspNet.OData -Version 5.9.1
You could get the dependencies relationship from the NuGet Package Manager page from Project -> Manage NuGet Packages. When you select one of the package, it will show its dependencies on right side. You could select the package version to check which version of dependencies should be installed for current version of package.
The relationship for the OData packages should be OData.Client 6.15 dependent on OData.Core 6.15 and OData.Core 6.15 dependent on OData.Edm 6.15.
But in your project, you installed OData.Core 7.0 and OData.Edm 7.0, which are not compatible with OData.Core 6.15.
So please install the correct version of OData.Core 6.15 and OData.Edm 6.15.

Unable to add Xamarin Google Play Services

I'm unable to add GCM to my Xamarin app. This is the output from the package console:
Adding Xamarin.GooglePlayServices.Gcm...
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Base (= 29.0.0.1)'.
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Basement (= 29.0.0.1)'.
Attempting to resolve dependency 'Xamarin.Android.Support.v4 (≥ 23.1.1.1)'.
Attempting to resolve dependency 'Xamarin.GooglePlayServices.Measurement (= 29.0.0.1)'.
Updating 'Xamarin.Android.Support.v4 23.0.1.3' to 'Xamarin.Android.Support.v4 23.3.0' failed. Unable to find a version of 'Xamarin.Forms' that is compatible with 'Xamarin.Android.Support.v4 23.3.0'.
For this version you must install an earlier version of Xamarin.GooglePlayServices.Gcm. I had no problems with 27.0.0.
If you need the newest version, you could do this:
uninstall xamarin.forms nuget package
update all android packages to 23.3.0
install Xamarin.GooglePlayServices.Gcm
search for xamarin.forms and set in options ignore dependencies
install newest version
Of course you must be aware of problems, since this is not recommended with good reasons.
You need to Update your Xamarin.Forms package. Open Packages (Dropdown) in Solutions pane and Right-Click on Xamarin.Forms and click on Update
If you are using PCL, you can find this package in the PCL (Xamarin.Forms) project.
If you are using Shared Asset Project, you will find this package in both Xamarin.Android and Xamarin.iOS project.
You have to update Android SDK Platform-tools to revision 26.0.2 (or equivalent).
Open Android SDK Manager, check update, and select
"Update avaiable rev.26.0.2" and install it.

Resources