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: ERR_NO_DEVICE: with cli 5.0.1 #4022

Closed
ctfrancia opened this issue Jun 6, 2019 · 23 comments
Closed

bug: ERR_NO_DEVICE: with cli 5.0.1 #4022

ctfrancia opened this issue Jun 6, 2019 · 23 comments
Labels

Comments

@ctfrancia
Copy link

Bug Report

Ionic version:

[x] 4.x

Current behavior:

Ever since upgrading to ionic cli 5 running my ionic app on my Android device is nearly impossible as I consistantly get the error

[native-run] ERR_NO_DEVICE: No hardware devices found. Not attempting emulator because --device was specified.

I am not sure if this is a 'native-run' issue but since i need it to launch the app on the Android device I thought here was the more appropriate.

I have had to go back to cli 4. so I can launch the app.

Expected behavior:

for my app to launch natively

Steps to reproduce:

$ ionic cordova run android --device --livereload
Related code:

insert short code snippets here

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.0.1 (/Users/user/.nvm/versions/node/v12.1.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 7.1.4, ios 4.5.5
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 8 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.2

System:

   Android SDK Tools : 26.1.1 (/Users/user/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v12.1.0 (/Users/user/.nvm/versions/node/v12.1.0/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001
@ctfrancia
Copy link
Author

ctfrancia commented Jun 6, 2019

I have tried:

  • restarting the device
  • restarting computer
  • restarting internet connection
  • unplugging the cable from computer to device
  • plugging it back in with different order
    I have the device set so that it doesn't go to sleep while compiling before launch.

@jcesarmobile
Copy link
Member

jcesarmobile commented Jun 6, 2019

Can you try updating to latest version of native-run? (0.2.3)
Does it work if you use --no-native-run? (that should use the old way)
Does Android Studio detect your device as connected?

@ctfrancia
Copy link
Author

ctfrancia commented Jun 6, 2019

Let me try those things.
have tried. I updated to 0.2.3 and it still didn't launch. Then without touching my phone or adjusting the cables or resetting the connection I did:
$ ionic cordova run android --device --livereload --no-native-run and that worked. 🤔

also, Android Studio did detect the phone was connected.

@viananicolas
Copy link

I was facing the same issue. Adding --no-native-run and downgrading platform-tools to version 28.0.2 did the trick.

@brandyscarney brandyscarney transferred this issue from ionic-team/ionic-framework Jun 12, 2019
@ionitron-bot ionitron-bot bot added the triage label Jun 12, 2019
@imhoffd
Copy link
Contributor

imhoffd commented Jun 12, 2019

@ctfrancia What is the output of native-run android --list --verbose ?

@ctfrancia
Copy link
Author

native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME +0ms
  native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_SDK_ROOT +1ms
  native-run:android:utils:sdk:resolveSDKRoot Using $ANDROID_SDK_ROOT at /Users/c.francia/Library/Android/sdk +2ms
  native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME +0ms
  native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at /Users/c.francia/.android +0ms
  native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME +0ms
  native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at /Users/c.francia/.android/avd +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platform-tools/package.xml +0ms
  native-run:android:utils:avd:getAVDINIs Discovered AVD ini files: [] +0ms
  native-run:android:utils:sdk:findAllSDKPackages Walking /Users/c.francia/Library/Android/sdk to discover SDK packages +0ms
  native-run:android:utils:adb:getDevices Invoking adb: '/Users/c.francia/Library/Android/sdk/platform-tools/adb' [ 'devices', '-l' ] +0ms
  native-run:android:utils:adb:parseAdbDevices Parsing adb devices from output lines: [
  native-run:android:utils:adb:parseAdbDevices   'List of devices attached',
  native-run:android:utils:adb:parseAdbDevices   'UN045654               device usb:338894848X ' +
  native-run:android:utils:adb:parseAdbDevices     'product:yamchalite model:Aquaris_U2_Lite device:yamchalite ' +
  native-run:android:utils:adb:parseAdbDevices     'transport_id:21',
  native-run:android:utils:adb:parseAdbDevices   '',
  native-run:android:utils:adb:parseAdbDevices   ''
  native-run:android:utils:adb:parseAdbDevices ] +0ms
  native-run:android:utils:adb:getDeviceProperties Invoking adb: '/Users/c.francia/Library/Android/sdk/platform-tools/adb' [ '-s', 'UN045654', 'shell', 'getprop' ] +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/emulator/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/tools/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/build-tools/28.0.3/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/patcher/v4/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-26/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-27/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-28/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/sources/android-27/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/sources/android-28/package.xml +0ms
  native-run:android:utils:sdk:api:getAPILevels Discovered installed API Levels: [
  native-run:android:utils:sdk:api:getAPILevels   {
  native-run:android:utils:sdk:api:getAPILevels     apiLevel: '28',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-28', 'sources;android-28' ]
  native-run:android:utils:sdk:api:getAPILevels   },
  native-run:android:utils:sdk:api:getAPILevels   {
  native-run:android:utils:sdk:api:getAPILevels     apiLevel: '27',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-27', 'sources;android-27' ]
  native-run:android:utils:sdk:api:getAPILevels   },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '26', packages: [ 'platforms;android-26' ] }
  native-run:android:utils:sdk:api:getAPILevels ] +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 28: Unsatisfied packages within API 28: system-images;android-28;google_apis_playstore;x86 +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 27: Unsatisfied packages within API 27: system-images;android-27;google_apis_playstore;x86 +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 26: Unsatisfied packages within API 26: system-images;android-26;google_apis_playstore;x86 +1ms
  native-run:android:utils:list:getVirtualTargets Error getting virtual targets: AVDException [Error]: No suitable API installation found.
  native-run:android:utils:list:getVirtualTargets     at getDefaultAVDSchematic (/Users/c.francia/.nvm/versions/node/v12.1.0/lib/node_modules/native-run/dist/android/utils/avd.js:92:11) {
  native-run:android:utils:list:getVirtualTargets   code: 'ERR_UNSUITABLE_API_INSTALLATION',
  native-run:android:utils:list:getVirtualTargets   exitCode: 1,
  native-run:android:utils:list:getVirtualTargets   data: undefined
  native-run:android:utils:list:getVirtualTargets } +0ms
  native-run:android:utils:adb:getDevices Found adb devices: [
  native-run:android:utils:adb:getDevices   {
  native-run:android:utils:adb:getDevices     serial: 'UN045654',
  native-run:android:utils:adb:getDevices     state: 'device',
  native-run:android:utils:adb:getDevices     type: 'hardware',
  native-run:android:utils:adb:getDevices     connection: 'usb',
  native-run:android:utils:adb:getDevices     properties: {
  native-run:android:utils:adb:getDevices       usb: '338894848X',
  native-run:android:utils:adb:getDevices       product: 'yamchalite',
  native-run:android:utils:adb:getDevices       model: 'Aquaris_U2_Lite',
  native-run:android:utils:adb:getDevices       device: 'yamchalite',
  native-run:android:utils:adb:getDevices       transport_id: '21'
  native-run:android:utils:adb:getDevices     },
  native-run:android:utils:adb:getDevices     manufacturer: 'bq',
  native-run:android:utils:adb:getDevices     model: 'Aquaris U2 Lite',
  native-run:android:utils:adb:getDevices     product: 'yamchalite',
  native-run:android:utils:adb:getDevices     sdkVersion: '25'
  native-run:android:utils:adb:getDevices   }
  native-run:android:utils:adb:getDevices ] +104ms
Connected Devices:

  bq Aquaris U2 Lite (API 25) UN045654

Virtual Devices:

  No virtual devices found

@imhoffd
Copy link
Contributor

imhoffd commented Jun 13, 2019

Oh, so it's finding the device (bq Aquaris U2 Lite (API 25) UN045654), I assume that's the target you wish to deploy to.

Could I also see the verbose logs for [native-run] when you try to use ionic cordova run android --device --livereload --verbose ?

Please also make sure you're on the latest version of native-run, there's been a few updates to both Android and iOS: npm i -g native-run@latest

@iva2k
Copy link

iva2k commented Jun 14, 2019

Here's my output of native-run android--list --verbose, note that it finds the connected Samsung S8 phone, but lists it as an "emulator". I wonder why it does so and how can I tell it to not do that (as it is a hardware device)?


C:\dev\starter\client\ionic4-feathersjsplus-starter>native-run android --list --verbose
  native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME +0ms
  native-run:android:utils:sdk:resolveSDKRoot Using $ANDROID_HOME at C:\Users\x\AppData\Local\Android\sdk +6ms
  native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME +0ms
  native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at C:\Users\x\.android +0ms
  native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME +0ms
  native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at C:\Users\x\.android\avd +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\platform-tools\package.xml +0ms
  native-run:android:utils:avd:getAVDINIs Discovered AVD ini files: [] +0ms
  native-run:android:utils:sdk:findAllSDKPackages Walking C:\Users\x\AppData\Local\Android\sdk to discover SDK packages +0ms
  native-run:android:utils:adb:getDevices Invoking adb: 'C:\\Users\\x\\AppData\\Local\\Android\\sdk\\platform-tools\\adb' [ 'devices', '-l' ] +0ms
  native-run:android:utils:adb:parseAdbDevices Parsing adb devices from output lines: [ 'List of devices attached',
  native-run:android:utils:adb:parseAdbDevices   '98897a474748594558     device product:dreamqltesq model:SM_G950U device:dreamqltesq transport_id:2',
  native-run:android:utils:adb:parseAdbDevices   '',
  native-run:android:utils:adb:parseAdbDevices   '' ] +0ms
  native-run:android:utils:adb:getDeviceProperties Invoking adb: 'C:\\Users\\x\\AppData\\Local\\Android\\sdk\\platform-tools\\adb' [ '-s', '98897a474748594558', 'shell', 'getprop' ] +0ms
  native-run:android:utils:adb:getDevices Found adb devices: [ { serial: '98897a474748594558',
  native-run:android:utils:adb:getDevices     state: 'device',
  native-run:android:utils:adb:getDevices     type: 'emulator',
  native-run:android:utils:adb:getDevices     connection: null,
  native-run:android:utils:adb:getDevices     properties:
  native-run:android:utils:adb:getDevices      { product: 'dreamqltesq',
  native-run:android:utils:adb:getDevices        model: 'SM_G950U',
  native-run:android:utils:adb:getDevices        device: 'dreamqltesq',
  native-run:android:utils:adb:getDevices        transport_id: '2' },
  native-run:android:utils:adb:getDevices     manufacturer: 'samsung',
  native-run:android:utils:adb:getDevices     model: 'SM-G950U',
  native-run:android:utils:adb:getDevices     product: 'dreamqltesq',
  native-run:android:utils:adb:getDevices     sdkVersion: '28' } ] +238ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\docs\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\emulator\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\tools\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\add-ons\addon-google_apis-google-24\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\build-tools\25.0.3\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\build-tools\26.0.1\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\build-tools\28.0.0\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\build-tools\28.0.2\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\build-tools\28.0.3\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\patcher\v4\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\platforms\android-23\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\platforms\android-25\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\platforms\android-27\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\platforms\android-28\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\sources\android-25\package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\x\AppData\Local\Android\sdk\sources\android-27\package.xml +0ms
  native-run:android:utils:sdk:api:getAPILevels Discovered installed API Levels: [ { apiLevel: '28', packages: [ 'platforms;android-28' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '27',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-27', 'sources;android-27' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '25',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-25', 'sources;android-25' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '24',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'add-ons;addon-google_apis-google-24' ] },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '23', packages: [ 'platforms;android-23' ] } ] +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 28: Unsatisfied packages within API 28: system-images;android-28;google_apis_playstore;x86 +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 27: Unsatisfied packages within API 27: system-images;android-27;google_apis_playstore;x86 +1ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 25: Unsatisfied packages within API 25: system-images;android-25;google_apis_playstore;x86 +1ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 24: Unsatisfied packages within API 24: platforms;android-24, system-images;android-24;google_apis_playstore;x86 +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 23: Unsupported API level: 23 +1ms
  native-run:android:utils:list:getVirtualTargets Error getting virtual targets: { Error: No suitable API installation found.
  native-run:android:utils:list:getVirtualTargets     at getDefaultAVDSchematic (C:\nvm\v8.11.2\node_modules\native-run\dist\android\utils\avd.js:92:11)
  native-run:android:utils:list:getVirtualTargets     at <anonymous>
  native-run:android:utils:list:getVirtualTargets   code: 'ERR_UNSUITABLE_API_INSTALLATION',
  native-run:android:utils:list:getVirtualTargets   exitCode: 1,
  native-run:android:utils:list:getVirtualTargets   data: undefined } +0ms
Connected Devices:

  No connected devices found

Virtual Devices:

  No virtual devices found

@iva2k
Copy link

iva2k commented Jun 14, 2019

Oh, forgot to mention, I have Windows 7 64-bit
ionic cordova run android --no-native-run works fine

Sifting through the verbose log, there is no "usb" anywhere, only "transport_id: 2" (the number changes depending on which USB port I plug into). So it must be the peculiarity of adb on windows and how native-run checks for hardware vs. the emulator (quick glance reveals it just searches for "usb" in adb report).

I hacked file 'C:\nodejs\node_modules\native-run\dist\android\utils\adb.js' to have:

                ...
                // const type = 'usb' in properties || isIP ? 'hardware' : 'emulator';
const isWinAdbTransport = true; // TODO: sophisticated test for "windows" && ('transport' in properties)
const type = 'usb' in properties || isIP || isWinAdbTransport ? 'hardware' : 'emulator';

and then the command ionic cordova run android works fine too.

@imhoffd
Copy link
Contributor

imhoffd commented Jun 15, 2019

@iva2k Thanks for diving deep into that stuff. From the sound of it, it kinda ties into this issue: ionic-team/native-run#36

@ctfrancia
Copy link
Author

I have just upgraded to 5.0.2 and the issue has came back and making connecting to the device very very difficult to do.

imhoffd added a commit to ionic-team/native-run that referenced this issue Jun 25, 2019
@imhoffd
Copy link
Contributor

imhoffd commented Jun 25, 2019

@ctfrancia @iva2k Please give the latest native-run a try to see if the issue is fixed. Thanks for your patience.

npm i -g native-run@latest

@ctfrancia
Copy link
Author

@dwieeb no problem, I understand it's not always so easy 😅 . I currently have installed ionic cli 5.1.0 / native-run@0.2.7 and I am still wrestling with it. Chrome inspector detects it (I know this is a different subject). I know you guys are working on it.

@imhoffd
Copy link
Contributor

imhoffd commented Jun 26, 2019

@ctfrancia The changes in the latest version of native-run should definitely work for your line of adb output:

98897a474748594558     device product:dreamqltesq model:SM_G950U device:dreamqltesq transport_id:2

Can I see the output of native-run android --list --verbose again?

@ctfrancia
Copy link
Author

ctfrancia commented Jun 27, 2019

@dwieeb

  $ native-run android --list --verbose
  native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME +0ms
  native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_SDK_ROOT +1ms
  native-run:android:utils:sdk:resolveSDKRoot Looking at following directories: [ '/Users/c.francia/Library/Android/sdk' ] +0ms
  native-run:android:utils:sdk:resolveSDKRoot Using /Users/c.francia/Library/Android/sdk +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 /Users/c.francia/.android +0ms
  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 /Users/c.francia/.android/avd +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platform-tools/package.xml +0ms
  native-run:android:utils:avd:getAVDINIs Discovered AVD ini files: [] +0ms
  native-run:android:utils:sdk:findAllSDKPackages Walking /Users/c.francia/Library/Android/sdk to discover SDK packages +0ms
  native-run:android:utils:adb:getDevices Invoking adb: '/Users/c.francia/Library/Android/sdk/platform-tools/adb' [ 'devices', '-l' ] +0ms
  native-run:android:utils:adb:parseAdbDevices Parsing adb devices from output lines: [
  native-run:android:utils:adb:parseAdbDevices   'List of devices attached',
  native-run:android:utils:adb:parseAdbDevices   'f4df108b               device usb:338894848X ' +
  native-run:android:utils:adb:parseAdbDevices     'product:OnePlus6 model:ONEPLUS_A6003 device:OnePlus6 ' +
  native-run:android:utils:adb:parseAdbDevices     'transport_id:1716',
  native-run:android:utils:adb:parseAdbDevices   '',
  native-run:android:utils:adb:parseAdbDevices   ''
  native-run:android:utils:adb:parseAdbDevices ] +0ms
  native-run:android:utils:adb:getDeviceProperties Invoking adb: '/Users/c.francia/Library/Android/sdk/platform-tools/adb' [ '-s', 'f4df108b', 'shell', 'getprop' ] +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/emulator/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/tools/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/build-tools/28.0.3/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/patcher/v4/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-26/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-27/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/platforms/android-28/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/sources/android-27/package.xml +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/c.francia/Library/Android/sdk/sources/android-28/package.xml +0ms
  native-run:android:utils:sdk:api:getAPILevels Discovered installed API Levels: [
  native-run:android:utils:sdk:api:getAPILevels   {
  native-run:android:utils:sdk:api:getAPILevels     apiLevel: '28',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-28', 'sources;android-28' ]
  native-run:android:utils:sdk:api:getAPILevels   },
  native-run:android:utils:sdk:api:getAPILevels   {
  native-run:android:utils:sdk:api:getAPILevels     apiLevel: '27',
  native-run:android:utils:sdk:api:getAPILevels     packages: [ 'platforms;android-27', 'sources;android-27' ]
  native-run:android:utils:sdk:api:getAPILevels   },
  native-run:android:utils:sdk:api:getAPILevels   { apiLevel: '26', packages: [ 'platforms;android-26' ] }
  native-run:android:utils:sdk:api:getAPILevels ] +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 28: Unsatisfied packages within API 28: system-images;android-28;google_apis_playstore;x86 +0ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 27: Unsatisfied packages within API 27: system-images;android-27;google_apis_playstore;x86 +1ms
  native-run:android:utils:avd:getDefaultAVDSchematic Issue with API 26: Unsatisfied packages within API 26: system-images;android-26;google_apis_playstore;x86 +0ms
Error with Android virtual targets: ERR_UNSUITABLE_API_INSTALLATION: No suitable API installation found.
  native-run:android:utils:adb:getDevices Found adb devices: [
  native-run:android:utils:adb:getDevices   {
  native-run:android:utils:adb:getDevices     serial: 'f4df108b',
  native-run:android:utils:adb:getDevices     state: 'device',
  native-run:android:utils:adb:getDevices     type: 'hardware',
  native-run:android:utils:adb:getDevices     connection: 'usb',
  native-run:android:utils:adb:getDevices     properties: {
  native-run:android:utils:adb:getDevices       usb: '338894848X',
  native-run:android:utils:adb:getDevices       product: 'OnePlus6',
  native-run:android:utils:adb:getDevices       model: 'ONEPLUS_A6003',
  native-run:android:utils:adb:getDevices       device: 'OnePlus6',
  native-run:android:utils:adb:getDevices       transport_id: '1716'
  native-run:android:utils:adb:getDevices     },
  native-run:android:utils:adb:getDevices     manufacturer: 'OnePlus',
  native-run:android:utils:adb:getDevices     model: 'ONEPLUS A6003',
  native-run:android:utils:adb:getDevices     product: 'OnePlus6',
  native-run:android:utils:adb:getDevices     sdkVersion: '28'
  native-run:android:utils:adb:getDevices   }
  native-run:android:utils:adb:getDevices ] +97ms

@ctfrancia
Copy link
Author

ctfrancia commented Jun 27, 2019

Sometimes it works on the first time. But, by large I constantly have to unplug, plug, restart the device and it's never garanteed that it will be recognized. I changed phones to a more recent one to see if that has changed anything, but, it still has a problem recognizing it.

@imhoffd
Copy link
Contributor

imhoffd commented Jun 27, 2019

Do you have adb installed globally (outside of your SDK) by chance?

@ctfrancia
Copy link
Author

these are my globals from npm:

/usr/local/lib
├── cordova@9.0.0
├── ionic@5.2.0
├── native-run@0.2.7
└── npm@6.9.0

@imhoffd
Copy link
Contributor

imhoffd commented Jun 27, 2019

It's not installed with npm. It may have been installed with homebrew or by simply downloading it. Could you post the output of which adb (the command may fail).

@iva2k
Copy link

iva2k commented Jun 27, 2019

@ctfrancia @iva2k Please give the latest native-run a try to see if the issue is fixed. Thanks for your patience.

npm i -g native-run@latest

@dwieeb I checked - native-run@latest now lists my phone in "Connected Devices"

@ctfrancia
Copy link
Author

@dwieeb after $ which adb I get adb not foundshould I get it?

@imhoffd
Copy link
Contributor

imhoffd commented Jun 28, 2019

@dwieeb I checked - native-run@latest now lists my phone in "Connected Devices"

Great to hear 👏

@ctfrancia I am calling this issue fixed. From your description here:

Sometimes it works on the first time. But, by large I constantly have to unplug, plug, restart the device

This is a lower-level adb issue. I get this with a newer Android phone as well. As far as I know, we just have to wait for adb and the Android tooling to fix these kinds of stability issues.

Thanks for your help debugging this. 👍

@imhoffd imhoffd closed this as completed Jun 28, 2019
@ctfrancia
Copy link
Author

👍 hopefully the native run will improve because it still works a lot better without using native run 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants