0
votes

In latest VS 2017 15.8.4 I've Xamarin 4.11.0.756, Xamarin Designer 4.14.221, Xamarin Templates 1.1.116, Xamarin.Android SDK 9.0.0.19 and Xamarin.iOS and Xamarin.Mac SDK 11.14.0.13 in Windows 10 Pro 64bit. Before creating project I've installed with AndroidSDKManager.exe only Android 5.1 SDK - API 22. Well, I started creating new solution "TestApp" from template "Cross-Platform" -> "Mobile application (Xamarin.Forms)" and I'm selected template "Master-Detail" with Android, iOS and Windows (UWP) with .NET Standard. Then in project "TestApp.Android" in properties I've changed target platform to "Android 5.1" and set minSDKversion to API 21 and target SDK version to API 22. And now I try to compile and I get errors:

Error NU1202 Package Xamarin.Android.Support.Design 25.4.0.2 incompatible with monoandroid51 (MonoAndroid,Version=v5.1). Пакет Xamarin.Android.Support.Design 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0) TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\TestApp.Android.csproj 1
Error max res 22, skipping mipmap-anydpi-v26 "max res 22, skipping mipmap-anydpi-v26". TestApp.Android Error No resource found that matches the given name: attr 'windowNoTitle'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 2
Ошибка No resource found that matches the given name: attr 'colorPrimaryDark'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 2
Error Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 2
Error No resource found that matches the given name: attr 'colorPrimary'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 2
Error No resource found that matches the given name: attr 'windowActionBar'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 2
Error No resource found that matches the given name: attr 'colorAccent'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 3
Error Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 4
Ошибка No resource found that matches the given name: attr 'colorAccent'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 4
Ошибка No resource found that matches the given name: attr 'windowActionModeOverlay'. TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\Resources\values\styles.xml 4
Error NU1202 Package Xamarin.Android.Support.v7.CardView 25.4.0.2 incompatible with monoandroid51 (MonoAndroid,Version=v5.1). Package Xamarin.Android.Support.v7.CardView 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0) TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\TestApp.Android.csproj 1
Error NU1202 Package Xamarin.Android.Support.v7.MediaRouter 25.4.0.2 incompatible with monoandroid51 (MonoAndroid,Version=v5.1). Package Xamarin.Android.Support.v7.MediaRouter 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0) TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\TestApp.Android.csproj 1
Error NU1202 Package Xamarin.Android.Support.v7.AppCompat 25.4.0.2 incompatible with monoandroid51 (MonoAndroid,Version=v5.1). Package Xamarin.Android.Support.v7.AppCompat 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0) TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\TestApp.Android.csproj 1
Error NU1202 Package Xamarin.Android.Support.v4 25.4.0.2 incompatible with monoandroid51 (MonoAndroid,Version=v5.1). Package Xamarin.Android.Support.v4 25.4.0.2 supports: monoandroid70 (MonoAndroid,Version=v7.0) TestApp.Android C:\Users\user\source\repos\TestApp\TestApp\TestApp.Android\TestApp.Android.csproj 1

What I did wrong or what is missing?

1
use Android 8.1 or 9 Platform tools and set Minimum Android to 5.1magicandre1981
@magicandre1981 I've try this way, but my application don't run on my 22 API device - it is stating and exit at once.amaranth
create a 5.1 Virtual Device in emulator and debug the app there to see what fails on 5.1 devices.magicandre1981

1 Answers

0
votes

First of all you should be having a latest version of monoandroid, 5.1 is a quite old one. The latest is 8.1 I think. You can try updating that first. Download latest Android SDK, change the target platform to be compiled using latest SDK.

Check this for refrence Xamarin - How to update Mono.Android version to resolve dependencies?

But if you want to use the 5.1 only, you will have to downgrade most of the nugets you are using, which includes Xamarin.Android.Support.Design too.