简体   繁体   中英

Error on creating new project with Prism for Xamarin.Forms

While creating a new Prism for Xamarin.Forms project with VS2017 I'm getting the following errors:

Could not find android.jar for API Level . This means the Android SDK platform for API Level is not installed. Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change your Xamarin.Android project to target an API version that is installed. (C:\\Users\\yoav\\AppData\\Local\\Android\\sdk\\platforms\\android-\\android.jar missing.) BlankApp3.Android

Error NU1202 Package Xamarin.Android.Support.Design 27.0.2.1 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.Design 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Error NU1202 Package Xamarin.Android.Support.v4 27.0.2.1 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v4 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Error NU1202 Package Xamarin.Android.Support.v7.AppCompat 27.0.2.1 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.AppCompat 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Error NU1202 Package Xamarin.Android.Support.v7.CardView 27.0.2.1 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.CardView 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Error NU1202 Package Xamarin.Android.Support.v7.MediaRouter 27.0.2.1 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.v7.MediaRouter 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Can anyone please tell me how to avoid such errors?

The error you are getting is quite clear about the problem. You are trying to use the Android Support packages for API version 27 which would be Android 8.1, while targeting Android 8.0. You have a couple of options:

  1. Ensure that you have the 8.1 SDK installed on your machine and re-target your Android project to 8.1.

  2. Downgrade the Android Support packages to 26.1.0.1

  3. Upgrade the Android Support packages to 28.0.0.1 as the Xamarin.Android team now cross compiles the Android Support libraries to support Android projects that are targeting older SDK versions back to 6.0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM