Swift Package Manager to Cocoapods - swift

I am developing an iOS Package with Swift Package Manager. Unfortunately, one of my client wants to use this package with Cocoapods. I found a lot of tips to move from Cocoapods to SPM but not in the other way.
Is there a way to do it ? Without recreating a new project?
Is there also a way to export the package as pre compiled package (via Cocoapods) ?

Related

Why is the latest stable version of Newtonsoft showing in Nuget Package Manager as 12.0.3 in one project and as 9.0.1 in another?

In my class library, Manage Nuget Packages shows the latest stable version of Newtonsoft as 12.0.3. In another application that references the class library, Manage Nuget Packages shows the latest stable version of Newtonsoft as 9.0.1
What would explain that difference, and how is it fixed in Visual Studio 2019? When I try to compile the application, it fails with the error that the class library's version of Newtonsoft is newer.
EDIT: I think I've found the reason: in the top right corner of the window the package source for the application was not nuget.org but Visual Studio Offline Sources.
Why is the latest stable version of Newtonsoft showing in Nuget
Package Manager as 12.0.3 in one project and as 9.0.1 in another?
When you install a nuget package, you should select the right nuget package source.
As it shows that, Visual Studio Offline Sources is your local nuget caches. It is required that you download the corresponding nuget version and then exist in this data source. So it depends on you and not all versions of the package are fully displayed.
nuget.org is the ultimate destination for developers releasing nuget packages. You can find every version of the package here. So you should check this link.
Check and enable that link.
Then, open Nuget Package Manager UI and choose nuget.org and you can find it.

Visual Studio 2017: Package Restore failed, Rolling back Package changes for 'Projectname'

Added the new Package using Package Manager console or manage nuget packages in Project it's not added project it's Throw below Error.
I was Check some Links Not give proper reason. why this problem in coming in vs2017
Anyone Know Share the knowledge.
Thanks in Advance
Visual Studio 2017: Package Restore failed, Rolling back Package changes for 'Projectname'
You could not install the package exceldatareader.dataset to the UWP project. That because this package only have the .NET Framework assemblies, which is not compatible with UWP project. You can download that package from nuget.org, then open it, you will find this package only have the assemblies for .NET 2.0 and .NET 4.5:
So this package is not compatible with UWP project, you can find the error message in the output window when you install it to the UWP project:
Hope this helps.

What is the effect of Updating NuGet Package Manager on Existing Projects?

I am working on VS2012 and have issue with installing Twilio Package via NuGet. It asks me to update NuGet Package Manager. I am concerned if updating NuGet Package Manager have effect on all the projects that are running without any issue. What are the effects of Package Manager Updates on existing projects or solution.
Coming from the Python world, I will attempt to see if I can help you here. Is the concern that a specific package will no longer be available to you if you do a global update on your NuGet package manager?
Is it possible then for you to install a specific NuGet version in a virtual machine encapsulating the project where you want to run with the Twilio package?
Otherwise, assuming all of the packages you use are regularly maintained, I'm not sure how an update to a package manager would affect them.

Could not install package 'NuGet.Client 3.2.0'

I'm working with RESTful webservice, getting error while adding package "System.Net.Http";
"The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.5.0'. "
So, to resolve above error i'm trying to install "NuGet client" from "Add Package" option in xamarin studio, but this time I'm facing another issue that is;
"Could not install package 'NuGet.Client 3.2.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."
please help to resolve this issue.
Xamarin Studio currently does not support NuGet 3. It is currently only supported in Visual Studio 2015.
It is not possible to upgrade Xamarin Studio so it supports NuGet 3 at this time. Installing the NuGet.Client NuGet package does not upgrade NuGet in Xamarin Studio.
I would instead look at using the Microsoft.Net.Http NuGet package which you can install into a portable class library project (PCL) and supports all Xamarin Android and Xamarin iOS projects.
I was able to grab a copy of System.Net.Http.dll from another project and manually add it as a reference to my Xamarin project. I put it in the packages folder and then browsed to it from the edit references dialog.
For people facing problem trying to add System.Net.Http...
I was able to solve the problem by using Microsoft.Net.Http instead of System.Net.Http. In Xamarin studio, Right click on your project > Add > Add NuGet Packages.. > search for "Microsoft Http Client Libraries" and click Add Package.

How can I add libraries to Xamarin Mono for Android project in VS2010?

I am working on a mono for Android application (my very first) that consumes a web api. In the documentation at xamarin.com there are examples on using different libraries such as RestSharp and Json.Net.
However, when I try to install these libraries via Nuget in my VS2010 project it failes with the following message:
Install failed. Rolling back... Could not install package
'Newtonsoft.Json 4.5.9'. You are trying to install this package into a
project that targets 'MonoAndroid,Version=v2.2', but the package does
not contain any assembly references that are compatible with that
framework. For more information, contact the package author.
How can I include such libraries in my project?
Thanks in advance.
Erwin
This error message indicates those libraries are not compatible with Mono for Android. You should ask the manufacturer of the libraries if they have a MfA compatible version. If you have the source code of the libraries you could also try to make a MfA library, using linked source files, yourself.
Not sure if you've tried this but if you're using xamarin studio and right click the component folder in your Android app project choosing add component should be able to solve your problem. This will add a reference to the component that is added. Components seem like they are mono compatible packages and what's good for your case is that there are components for both RestSharp and Json.Net:
https://components.xamarin.com/view/restsharp
http://components.xamarin.com/view/json.net/