-
Notifications
You must be signed in to change notification settings - Fork 996
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: TypeError if no device exists. (run android) #6056
Comments
I can't reproduce. Can you provide your native-run and @ionic/cli versions?
and then run |
I run ionic as npm script. So my workspace version is used. It's 6.19.0 (same with 6.20.3). npx native-run is 1.7.0. Script: Ok as I see now the error only appears then hit enter when no list appears.
Without knowing the code, I think there is no if-condition or optional chaning of the selected entry. The selected item variable is just used direactly and tries to read ts value.
without any device/emulator connected {
"devices": [],
"virtualDevices": [],
"errors": [
{
"error": "No suitable API installation found. Use --sdk-info to reveal missing packages and other issues.",
"code": "ERR_UNSUITABLE_API_INSTALLATION"
}
]
} device connected {
"devices": [
{
"platform": "android",
"model": "BLABLABLA",
"sdkVersion": "28",
"id": "BLABLABLA"
}
],
"virtualDevices": [],
"errors": [
{
"error": "No suitable API installation found. Use --sdk-info to reveal missing packages and other issues.",
"code": "ERR_UNSUITABLE_API_INSTALLATION"
}
]
} Weird error. I already tried I wonder what library calls Another issue is to automatically select the connected device. Espacially if only one device is connected. In my list I only have one device. And sometimes I run this command and forget to select it. ^^ But I remember the early Capacitor days where you needed to run the project in Android Studio. Glad to see that Capacitor works over CLI now (like Cordova) to run on device. 👍 Anyway this issue described here is not critical. I just thought I could report this minor issue to improve it a bit. Btw. I don't understand why this command "will create a new emulator". It would also be wrong behavior to do so. Long story short: We just need to know where the |
The problem is your android SDK is not correctly installed, it’s missing some packages. the --sdk-info parameter is for native-run command, it doesn’t exist on capacitor nor ionic |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
We could show "No device found". instead of accessing an undefined variable (error).
cap v3.4.3, Windows 10
The text was updated successfully, but these errors were encountered: