ionic-team / vscode-ionic

Visual Studio Code Ionic Extension
Other
10 stars 1 forks source link

Stuck on Getting Devices #164

Open sir-captainmorgan21 opened 1 month ago

sir-captainmorgan21 commented 1 month ago

Version: v1.89.0

When I try to run the app for Android or iOS, nothing really happens. The loading spinner shows up, but the "Output" for ionic has nothing in it, and its stuck on "Getting Devices" at the bottom. Running the Web app from the ionic plugin works fine. Running npx cap run ios and npx cap run android manually both work fine as well.

I checked the devtools. There were no errors in the console.

image
dtarnawsky commented 1 month ago

"Getting Devices...." means that on the command line that it is running npx cap run ios --list

Running this on the command line may give you an idea of why it is not working. You can also use Help > Toggle Developer Tools to see if there are any related errors there.

My guess is that the installed version of native-run is broken. You can delete node_modules and npm install again to reinstall this. You could also update to the latest Capacitor 5 and run npm update to make sure your dependencies are updated.

sir-captainmorgan21 commented 1 month ago

@dtarnawsky thanks for the response. Running npx cap run ios --list lists out the available devices rather quickly. Also I have cracked open dev tools and didn't see any errors. We are also already on Cap 5. Any other suggestions?

dtarnawsky commented 1 month ago

I would guess this may be related to your project. If possible, can you share code? You can email me damian@ionic.io

(If you can't share the whole project you could share your package.json, package-lock.json and any configuration files in the root folder - you can omit the src folder).

sir-captainmorgan21 commented 1 month ago

@dtarnawsky I have a feeling it might be. It did work at one point. Not sure when it stopped. Ill shoot you an email. Thanks!

dtarnawsky commented 1 month ago

Coincidentally this option also stopped working on my machine as well. The ultimate problem for me was that NKDaemon was running (which is a service installed by Native Instruments when using the Traktor DJ software). This service presents itself as an offline android emulator causing problems.

To work out that there was a problem I ran this command: npx native-run android --list --verbose

Native-run is the library that the Capacitor CLI uses to iterate over available devices. The above command is essentially what is called when "Getting Devices" is run and this can fail if there are problems with either android or iOS. The --verbose will help surface any errors you may be getting.

sir-captainmorgan21 commented 2 weeks ago

@dtarnawsky thanks, but I ran that command for both android and ios, and didn't receive any issues. Devices were listed out without a problem