Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] debug single uitest causes unhandled exception #7207

Closed
BrayanKhosravian opened this issue Aug 19, 2019 · 4 comments · Fixed by #7228
Closed

[Bug] debug single uitest causes unhandled exception #7207

BrayanKhosravian opened this issue Aug 19, 2019 · 4 comments · Fixed by #7228
Labels
a/uitest p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@BrayanKhosravian
Copy link
Contributor

BrayanKhosravian commented Aug 19, 2019

Description

I am working on the issue 7167 and i created a view, vm, a test case and fixed the problem actually. now i added a uitest to my namespace and while debugging i get an unhanded exception.
I made sure that all the sdks are installed. i also added manully 2 envirment variables which point to "ANDROID_HOME". I also installed the lates nunit test adapter.,

This is the error msg:

`NUnit.Framework.InconclusiveException: 'App did not start for some reason: System.Exception: Android SDK not found. Please install it and if it is still not located, please set the ANDROID_HOME environment variable to point to the directory.

Searched locations:
Windows Registry
(No path) - Not set. [ Source: ANDROID_HOME ]
at Xamarin.UITest.Shared.Dependencies.AndroidSdkFinder.GetTools()
at Xamarin.UITest.Shared.Android.DefaultAndroidFactory.BuildExecutor(IProcessRunner processRunner)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration, IExecutor executor)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at Xamarin.Forms.Controls.AppSetup.InitializeAndroidApp() in C:\optiq\Xamarin.Forms\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\TestPages\TestPages.cs:line 63
at Xamarin.Forms.Controls.AppSetup.InitializeApp() in C:\optiq\Xamarin.Forms\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\TestPages\TestPages.cs:line 40
at Xamarin.Forms.Controls.AppSetup.Setup(Type pageType) in C:\optiq\Xamarin.Forms\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\TestPages\TestPages.cs:line 220'
`

Steps to Reproduce

  1. clone my forket xamarin forms repository https://github.com/BrayanKhosravian/Xamarin.Forms
  2. switch branch to "issue_7167"
  3. press ctrl + t to search for my class with the name "Issue7167.xaml.cs"
  4. the vm, and all other components are located there. just execute my test in debug

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE: Visual studio 2019 16.2.2

Screenshots

image
image
image
image

Reproduction Link

https://github.com/BrayanKhosravian/Xamarin.Forms

@BrayanKhosravian BrayanKhosravian added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 19, 2019
@pauldipietro pauldipietro added this to New in Triage Aug 19, 2019
@samhouts
Copy link
Member

@BrayanKhosravian It sounds like you're trying to run the test on an emulator. Does it work if you start the Android emulator from the device manager before you run the test?

@samhouts samhouts added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Aug 20, 2019
@samhouts samhouts moved this from New to Needs Info in Triage Aug 20, 2019
@BrayanKhosravian
Copy link
Contributor Author

@samhouts thanks for your response.
i tried to run the uitest also after running the emulator and this is the error im getting:
image

What i already tried:

  • updated from VS version 16.2.2 to 16.2.3 as it seems to fix the "Android sdk not found". it still didnt resolve my issue
  • tried to execute the uitests when i was connected with my real phone

@BrayanKhosravian
Copy link
Contributor Author

i fixed it finally.
image

@BrayanKhosravian
Copy link
Contributor Author

i created a pull request with the changes so that this error wouldnt happen to other devs
sincerely

@samhouts samhouts added this to In Progress in v4.3.0 Aug 21, 2019
@samhouts samhouts removed this from Needs Info in Triage Aug 21, 2019
v4.3.0 automation moved this from In Progress to Done Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/uitest p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/unverified New report that has yet to be verified t/bug 🐛
Projects
No open projects
v4.3.0
  
Done
3 participants