-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[VSCode] Unable to select iOS and Android devices #192
Comments
Why the error occurs (Android)Like you, I got the following error in the VSCode extension log window: [2021-06-20 08:37:28.569] [exthost] [error] TypeError: Cannot read property 'devices' of undefined
at MobileProjectManager.<anonymous> (c:\Users\[...]\.vscode\extensions\clancey.comet-debug-0.3.7\dist\extension.js:22161:51)
at Generator.next (<anonymous>)
at fulfilled (c:\Users\[...]\.vscode\extensions\clancey.comet-debug-0.3.7\dist\extension.js:21852:58)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5) dotnetmobile.selectDevice The vscode extension for Comet makes use of the
For android, it runs For iOS it runs If you run these commands manually with the command line you'll get an error, the extension does ignore the error and tries to parse the empty JSON result, and fails when mapping the value. You can find the source code of the The actual error on Android occurs in AndroidSdk.cs:102: It tries to find the device data for the emulator which was shown as connected in my case when running Solution (Android)In my case, my system somehow had an emulator registered in AVDManager that did not even exist on disk (in a fresh installation). Note that I can only provide the Windows command because I do not have an OS X system at hand. To verify, run the following command: After some debug console output, I've got the following: The following Android Virtual Devices could not be loaded:
Name: pixel_2_pie_9_0_-_api_28
Path: C:\Users\[username]\.android\avd\pixel_2_pie_9_0_-_api_28.avd
Error: Google pixel_2 no longer exists as a device To delete this device, run You can ignore any errors because it tries to delete the emulator from the disk, which does not even exist. Now run the following command again:
Now run {"id":"82a0c173-956a-407b-848f-56e363122246","command":"android-devices","response":[]} (The GUID can differ) Now start up your emulator, restart Visual Studio Code (should work without a restart but safe is safe), select net6.0-android, and click on "Select device". Now it should work: It also works on a physical device now: Alternative Solution (Android)
Why the error occurs (iOS)I tried to run the On an OS X machine, you may get probably a similar error with the correct path. Hope I could help! |
Hi! I'm having a similar error here. I'm getting an error only when I try to select a virtual android When I click on "Select a Device" throws the error:
The Android Virtual Device is running (started from VDM of Android Studio) Next is the output of the commands mentioned in previous comments. Running mobile-debug:
I added to PATH the path to platform-tools folder, but the error is still there.
Running adb:
Running avdmanager:
Android Studio info:
openjdk: microsoft-openjdk11 (installed with brew. version 11 Required by Maui) |
I can run Mac Catalyst, but when choosing Android and iOS I cannot select a device. The error is the same both times:
Log (Extension Host) reports:
I'm running macOS Monterey and .NET 6 Preview 5.
I can run iOS from CLI just fine.
The text was updated successfully, but these errors were encountered: