You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Trying to run yarn ionic cordova run android --livereload --device leads to the error below. I'm running the command on WSL, adb and yarn are installed on WSL.
$ which yarn && which adb
/usr/bin/yarn
/opt/android/platform-tools/adb
yarn run v1.22.18
$ /path-to-project/node_modules/.bin/native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --device --forward 8100:8100 --verbose
native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME +0ms
native-run:android:utils:sdk:resolveSDKRoot Using $ANDROID_HOME at /opt/android +3ms
native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME +0ms
native-run:android:utils:sdk:resolveEmulatorHome Looking at $HOME/.android +0ms
native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at /home/mbenoukaiss/.android +1ms
native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME +0ms
native-run:android:utils:sdk:resolveAVDHome Looking at $HOME/.android/avd +0ms
native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at /home/mbenoukaiss/.android/avd +1ms
native-run:android:utils:adb:getDevices Invoking adb with args: [ 'devices', '-l' ] +0ms
native-run:android:utils:sdk:getSDKPackage Parsing /opt/android/platform-tools/package.xml +0ms
native-run:android:utils:adb:parseAdbDevices Parsing adb devices from output lines: [
native-run:android:utils:adb:parseAdbDevices 'List of devices attached\r',
native-run:android:utils:adb:parseAdbDevices '22005523027480 device product:TC21MG model:TC21 device:TC21 transport_id:1\r',
native-run:android:utils:adb:parseAdbDevices '\r',
native-run:android:utils:adb:parseAdbDevices ''
native-run:android:utils:adb:parseAdbDevices ] +0ms
native-run:android:utils:adb:parseAdbDevices adb devices output line does not match expected regex: '22005523027480 device product:TC21MG model:TC21 device:TC21 transport_id:1\r' +0ms
native-run:android:utils:adb:parseAdbDevices adb devices output line does not match expected regex: '\r' +0ms
native-run:android:utils:adb:getDevices Found adb devices: [] +82ms
native-run:android:utils:avd:getAVDINIs Discovered AVD ini files: [
native-run:android:utils:avd:getAVDINIs '/home/mbenoukaiss/.android/avd/Pixel_3_API_30.ini',
native-run:android:utils:avd:getAVDINIs '/home/mbenoukaiss/.android/avd/Pixel_3_API_31.ini'
native-run:android:utils:avd:getAVDINIs ] +0ms
native-run Caught fatal error: AndroidRunException [Error]: No hardware devices found. Not attempting emulator because --device was specified.
native-run at selectDevice (/path-to-project/node_modules/native-run/dist/android/run.js:83:19)
native-run at async Object.run (/path-to-project/node_modules/native-run/dist/android/run.js:32:20)
native-run at async Object.run (/path-to-project/node_modules/native-run/dist/android/index.js:19:5)
native-run at async Object.run (/path-to-project/node_modules/native-run/dist/index.js:20:13) {
native-run code: 'ERR_NO_DEVICE',
native-run exitCode: 1,
native-run data: undefined
native-run } +0ms
ERR_NO_DEVICE: No hardware devices found. Not attempting emulator because --device was specified.
More details for this error may be available online:
https://github.com/ionic-team/native-run/wiki/Android-Errors
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Adding/changing the lines from 232 to 235 in the file adb.js in the screenshot below fixes the problem, idk if it's the best way to fix it though :
Version:
1.4.0
Description:
Trying to run
yarn ionic cordova run android --livereload --device
leads to the error below. I'm running the command on WSL, adb and yarn are installed on WSL.Command Output:
Command ran :
yarn native-run android --app platforms/android/app/build/outputs/apk/debug/app-debug.apk --device --forward 8100:8100 --verbose
Output :
Adding/changing the lines from 232 to 235 in the file
adb.js
in the screenshot below fixes the problem, idk if it's the best way to fix it though :Link to the concerned line in the project : https://github.com/ionic-team/native-run/blob/develop/src/android/utils/adb.ts#L362:L366
SDK Info:
The text was updated successfully, but these errors were encountered: