Generate nugetpackage for android class library vs 2017 - xamarin.ios

I have noticed that when using a specific library eg "android class library" or ios one there is no option to automatically generate the nuget package ,this option is available for std class library.
How can i quickly generate a nuget package for my android of ios class library?

Related

What project type can reference .NET assemblies and can be referenced by an iOS Xamarin app

I'm looking for some help to setup my Visual Studio for Mac project properly. I'm new to Visual Studio Mac and would appreciate a shove down the right road.
I have a large class library, originally developed in visual studio 2017 on Windows.I'd like to use much of that code to develop an iOS application. This class library requires references to:
System
System.Runtime.Serialization
System.ServiceModel
System.ServiceModel.Web
System.Web.
I have tried porting that code to a Portable Class Library in Visual Studio for Mac. However PCLs don't allow you to reference the above assemblies (unless I'm missing something).
So I then ported it to .NET Library project (Other -> .NET -> Library) project. However, my iOS app won't allow references to that project type because VS for Mac says it has an "Incompatible Target Framework: .NETFramework, Version-v4.6.1).
What project type should I be using for this class library so that it can reference the needed .NET assemblies and it can be referenced from my iOS application?
Possible options:
Use a different Portable Class Library (PCL) profile.
Use a .NET Standard project.
Use a shared project.
For everything apart from System.Web, there are PCL profiles that have the assemblies you are looking for. You can see which assemblies are available on the Mac by looking in the PCL directory:
/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable
If you open a terminal window there you can run a search, find . -name "System.ServiceModel.Web.dll", or browse the folders using Finder to find a PCL profile that has the assemblies you need.
Another possibility would be to use a .NET Standard 2.0 project which has a lot of assemblies that can be used and supports being referenced by a Xamarin.iOS project. You may need to install some other System.* NuGet packages to provide the required assemblies.
The namespaces available in .NET Standard 2.0 are documented:
https://learn.microsoft.com/en-us/dotnet/api/?view=netstandard-2.0
Another option is using a shared project. This does not have assembly references itself but is basically shared code that is compiled into all projects that reference it. Here you can use #ifdefs for any code that is iOS or Android specific.

Incorporate 3rd Party Native Libs into Android Studio project

I am trying to setup an NDK library module structured very similar to the gen-libs module in the Android-NDK sample project. It identifies what I want in an Android NDK library module to allow me to incorporate 3rd party Native Libs:
src/main/cpp
CMakeLists.txt
Android manifest
build.gradle
I am NOT looking to add C or C++ source files to my app module.
Instead, I am looking to create an Android-NDK library module within Android Studio, so that I can incorporate 3rd Party Native Libs.
However, I am Unable to easily reproduce the structure of the gen-libs module in Android-NDK sample hello-libs.
More specifically, Android Studio does not provide any option to create a "New => Module => Android Library => Add NDK/C++ support"
I suppose I can recreate this NDK module manually, but before I do that, I would like to ask the community if, for a brand new project, is there any easy way to auto-create the gen-libs module structure from hello-libs beside manual method?
Feel free to use your copy/paste skills to produce the project manually. The wizard won't do it for you, at least for now.
You can also create an app project and switch it to library by changing one line in build.gradle.
You can also create a library module, right click on this module, and choose 'Link C++ Project with Gradle' from the popup menu (or from File menu).

Custom Library Dependency Android?

Is it possible to add your own private custom libraries as part of the library dependency that comes built into Android Studio?
The idea is that this can be a way to deliver libraries from our mobile library team to our app development team quickly and easily.

Can't Reference Portable Class Library Project Xamarin.iOS

When I try to add a portable class library in Visual Studio, it only gives me an option for "Xamarin.iOS (Classic)" and not "Xamarin.iOS". So when I try to add the project as a reference to my ios project, I'm unable to add a reference from a none classic ios app to a portable library.
PCLs are supported for both iOS Classic and iOS Unified.
On the Mac the PCL profiles are installed with Mono 3.10.
On Windows the PCL profiles for iOS Unified are not installed by default since they require a new version of NuGet 2.8.3 which is currently available as an alpha release. To get the PCL profiles for iOS Unified there is a separate installer which will install NuGet 2.8.3 into Visual Studio and install the PCL profiles.
There is a blog post about what iOS Unified is compared with iOS Classic.
Found the answer here Thanks Matt Ward

Create dll from ios library

I have several libraries created in Xamarin IOS on mac (don't use Visual Studio). I want to create the libraries is in a Dlls of this project. How can i do it.
When building a ios library too release it will creates a dll in the bin folder

Resources