Errors when referenace android project to ui test project Xamarin

Hello i have a intruder problem, i have created a xamarin form solution with monoandroid 8.1 and .net standard 2.0 and every thing going fine, once i have add UI test project and add android project as reference i see 4 errors but when i build it build successfully and still see error, and when i build it in app center it fails and show me those 4 errors

and this is log from app center

2018-06-11T10:26:21.6746020Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1). Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6783670Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6823120Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6861720Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6902870Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6943750Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1). Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.6981290Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7019080Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7057150Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7095020Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7132900Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7171470Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7221190Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7278400Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7336420Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7393870Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7451220Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7509030Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x64. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7565940Z NU1201: Project UserLogin.Android is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Project UserLogin.Android supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7622890Z NU1202: Package Xamarin.Android.Support.Design 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7687110Z NU1202: Package Xamarin.Android.Support.v7.AppCompat 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.AppCompat 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7746930Z NU1202: Package Xamarin.Android.Support.v4 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v4 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7802140Z NU1202: Package Xamarin.Android.Support.v7.CardView 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.CardView 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1) 2018-06-11T10:26:21.7856710Z NU1202: Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 is not compatible with net471 (.NETFramework,Version=v4.7.1) / win-x86. Package Xamarin.Android.Support.v7.MediaRouter 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)

Best Answer

Answers

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @MuhammadAbuMandour

    This sounds like an App Center issue. Please use App Center support:
    https://docs.microsoft.com/en-us/appcenter/general/support-center

  • MuhammadAbuMandourMuhammadAbuMandour USMember ✭✭

    its not related to app center, errors appear in visual studio also it build successfully

  • Harikrishnan_NHarikrishnan_N Member ✭✭

    @MuhammadAbuMandour : Did you get any solution?

  • JannikRJannikR Member ✭✭
    edited February 6

    Did you maybe add the Android Project as Reference to your UI Test project ?
    This is not necessary and possible !

    Inside your UI Test Project you link to your app like this:

    return ConfigureApp.Android
                                       .EnableLocalScreenshots()
                                       .ApkFile(@"D:\TestProject\Output\UnitTest\com.myapp.apk")
                                       .StartApp();
    
  • Harikrishnan_NHarikrishnan_N Member ✭✭
    edited February 6

    @JannikR : That does not work.

    Even am not trying it out with any new project. It is just the project that is downloaded from the below Xamarin documentation.
    Link: developer.xamarin.com/samples/xamarin-forms/UsingUITest/

    Herewith I have attached the issue reproducing the sample. The test case does not launch at all.

  • MuhammadAbuMandourMuhammadAbuMandour USMember ✭✭

    @JannikR said:
    Hi @Harikrishnan_N ,

    looking at your project you missed to configure a few things:
    1. Your Android Project need to request INTERNET permissions.
    2. You need to disable the "Use Shared Mono Runtime" Property in the Android Build settings of your Android Project
    3. You should update the NuGet Packages for NUnit and Xamarin.UITest to avoid getting and old bug where it is not able to find your apk file.
    4. (not very relevant) The output path from your android project is different than the path you configured for your .apk file

    Changing this your project works for me and I can run the tests.

    Here you can find some additional information about how to configure your projects for UITest:
    docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/uitest

    I hope you will be able to solve this issue.

    @JannikR said:
    Hi @Harikrishnan_N ,

    looking at your project you missed to configure a few things:
    1. Your Android Project need to request INTERNET permissions.
    2. You need to disable the "Use Shared Mono Runtime" Property in the Android Build settings of your Android Project
    3. You should update the NuGet Packages for NUnit and Xamarin.UITest to avoid getting and old bug where it is not able to find your apk file.
    4. (not very relevant) The output path from your android project is different than the path you configured for your .apk file

    Changing this your project works for me and I can run the tests.

    Here you can find some additional information about how to configure your projects for UITest:
    docs.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/uitest

    I hope you will be able to solve this issue.

    i think this is the solution, for me i just update visual studio and Xamarin SDKs and it solved, any way the steps @JannikR siad very useful even for get more information about this error

Sign In or Register to comment.