Can't run UI test on Android Emulator

AgtrixAgtrixAgtrixAgtrix AUMember ✭✭
edited January 2015 in Xamarin Test Cloud

Hi, I am getting an error loading apk file in my Xamarin UI Test project:

Mono Shared Runtime is not supported. This can be resolved by changing the project configuration or using a Release build.

Can anybody tell what's wrong? Attached is snapshot of error in code.

Answers

  • BobDobsonBobDobson USMember

    I concur with the solution posted above. Worked like a champ for me.

  • In release build in my project, this option is disabled (turned off) and the error still appear.

    Sorry by my english!

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @RafaelBolaos.4405 The error you are seeing may be an artifact from an earlier build. Try clean all and rebuilding.

    It is also a good idea to make sure that you are using the latest stable Xamarin.UITest nuget package.

  • FrancoisMFrancoisM FRUniversity ✭✭
    edited March 2016

    As I saw that error too so I disabled the option but now that app doesn't run at all on the simulator!
    It says:

    [Inspector] Can't inspect Android apps unless 'Fast assembly deployment' is enabled
    Android application is debugging.
    The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).

    Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.
    [Inspector] Can't inspect Android apps unless 'Fast assembly deployment' is enabled

    Of course the activity is a MainLauncher and the project is set to Deploy...

    I had to use a Release build which is not in line with the doc:
    https://developer.xamarin.com/guides/testcloud/uitest/intro-to-uitest/

  • GerryHGerryH USMember
    edited March 15

    I am getting this error with a Release build with Shared Mono Runtime turned off.

    I keep trying to run it over and over, including rebuilding and running the app manually (multiple times). Eventually the tests ran. Not sure what I did that made it work.

  • PeterSimonsPeterSimons GBMember ✭✭

    I am gettings this problem too.
    I am using Xamarin.UITest package 2.0.9,
    we have a run config with shared runtimes disabled.
    Works fine when running the tests on the command line against the emulators
    Also works fine when running against a physical device
    it does very occasionally run the android test(s) from the ide(VS for MAC and Xamarin studio) against the simulator
    It seems to hang after deploying to the device.

    We have spent a lot of time trying investigating this and trying to resolve it. Any further advice would be much appreciated

  • Ali.RussellAli.Russell USUniversity

    Any luck?

    I have a very similar problem in that uploading the APK and UITest project/dll to Xamarin Test Cloud from a VSTS build gives the following

    Mono Shared Runtime is not supported. This can be resolved by changing the project configuration or using a Release build.

    Of course the shared runtime is disabled in the .csproj
    <AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>

    Also using Xamarin.UITest 2.09 (although same issues exists when using 2.08)

    This doesn't happen when using "Release", but when creating a new config called "Release UITest" copied from "Release" where the PCL points to different services it does.

  • ShantimohanElchuriShantimohanElchuri USMember ✭✭✭✭

    The latest version of NUnit that works with Xamarin Forms is 2.6.4. Update to this version see if it resolves your woes.

  • Ali.RussellAli.Russell USUniversity

    Cheers, but I'm already on NUnit 2.6.4 too.

  • PeiyuanZhouPeiyuanZhou USMember

    Hello,

    Having NUnit 2.6.4 and Xamarin.UITest 2.1.4.

    I toggled with Release/Debug and Mono Shared Runtime on/off, but still got error of SetUp : System.Exception : Mono Shared Runtime is not supported. This can be resolved by changing the project configuration or using a Release build.

    Could anyone help with this?

    Thanks!

  • akrasztakraszt ROMember ✭✭

    Also have this issue
    I uninstalled the Mono Shared Runtime app from my android device
    Also did: Right Click on your SOLUTION(not project) -> Properties -> Now under configuration for each project, select "Release". selecting Release will automatically uncheck "Use Shared Runtime"

    I still get the error

    Even more, if I deploy my app from Visual studio 2017 to my Nexus 5x with Android 8.0 - the app launched but it also installs Mono Shared Runtime back on the phone..

    Has anyone figured it out yet? I am at a total loss..

  • akrasztakraszt ROMember ✭✭

    Make sure that when setting the apkPath you get it from the Release folder and not from the Debug folder.
    You have to generate the .apk for the Relesase folder
    Right Click on solution - Archive all - Distribute - Ad hoc

Sign In or Register to comment.