I am creating a Xamarin.UITest
for my android project. I am following the Microsoft guide. Everything works fine right up untill the last point:
Add a project reference from the UITest project to the Xamarin.Android project:
This will allow the NUnitTestAdapter to run the UITests for the Android app from Visual Studio.
As soon as I add a reference to an Android project it gives these errors:
NU1201: Project uitest.Android is not compatible with net461 (.NETFramework,Version=v4.6.1). Project uitest.Android supports: monoandroid81 (MonoAndroid,Version=v8.1)
Which makes perfect sense because obviously a .Net Framework 4.6.1
library knows nothing about MonoAndroid.
I have also tried converting it to .Net Standard 2.0
but I get a similar error:
Error NU1201 Project uitest.Android is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project uitest.Android supports: monoandroid81 (MonoAndroid,Version=v8.1)
Strangely the project still builds despite the errors. BUT these errors fail my automated build nuget restore with exactly the same error.
The reason the UI Test references the Android project is for the Xamarin Test Cloud
to be able to call:
if (platform == Platform.Android)
{
return ConfigureApp.Android.StartApp();
}
return ConfigureApp.iOS.StartApp();
You can't use InstalledApp
or ApkFile
methods in Xamarin test cloud
Have I misunderstood something or is this a visual studio / Xamarin bug?
PS. I am using latest Visual Studio version VS 15.8.0