Starting with Visual Studio 2017 15.5.1, how to create a Xamarin.Forms project for minimum Android KitKat (API 19) with PCL is now deprecated?

I want to know how to create a Xamarin.Forms project that is designed for the minimum version of Android Kitkat (API 19) without using the "General project" option.

. The Standard Standard Library is not an option since the minimum supported version of Android is Nougat . Most of my target users (over 40%) still use phones with an Android version lower than Nougat.

In Visual Studio 15.5.1 or later, the Code separation strategies section does not include the PCL parameter when creating a new Xamarin.Forms project when using a Cross-platform application .

enter image description here

It was noted that PCL is now deprecated at the Xamarin Forum , as well as the Visual Studio Developer Community

Key supporting questions:

  • With the latest versions of Vs 2017 PCL is still possible with Xamarin.Forms? And How?
  • If so, what are the steps to create a PCL-based Xamarin.Forms project, and are there any open templates for downloading this?
  • If not, does this mean that I can support Android KitKat using Xamarin.Forms using a shared code strategy / pattern for sharing code?
+5
source share
1 answer
  • Forms support Android 4.0.3 (API 15) and higher, you confuse the " Target Framework " ( compileSdkVersion ) for the " target version of Android " ( targetSdkVersion ) and the "Minimum version of Android" ( minSdkVersion ).

    • Your Xamarin.Form project should use a target structure of Nougat / 7.0 ( MonoAndroid7.0 ) or higher, but can target at least version 4.0.3 / IceCreamSandwich.

      • Note. The latest version of forms requires a target structure of 8.0
    • Xamarin has an excellent guide explaining how these things relate to Android before Xamarin.Android

  • Microsoft has completely removed the template for creating PCL-based libraries

    • PCL projects still build great

    • NetStandard is the only future, PCL is dead, etc. etc.

    • IMHO has changed since many of my clients are not ready to convert to NetStd, and NetStd errors still remain (mainly, extreme cases)

    • You still need to create a PCL library, grab an existing project and copy, split and rename it ... or create .csproj yourself (see the basic .csproj ).

Main profile111 PCL .csproj :

 <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{C38DBA87-39CB-4FD5-B409-6D19E6ED54C8}</ProjectGuid> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <UseMSBuildEngine>true</UseMSBuildEngine> <OutputType>Library</OutputType> <RootNamespace>PCLTemplate</RootNamespace> <AssemblyName>PCLTemplate</AssemblyName> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug</OutputPath> <DefineConstants>DEBUG;</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <Optimize>true</Optimize> <OutputPath>bin\Release</OutputPath> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Compile Include="MyClass.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> </Project> 
+3
source

Source: https://habr.com/ru/post/1274299/