ionic-team / native-run

Utility for running native binaries on iOS and Android devices and simulators/emulators
MIT License
120 stars 21 forks source link

native-run stopped working #383

Closed waltercruz closed 1 month ago

waltercruz commented 1 month ago

Version:

2.0.1

Description:

I use ionic to develop apps. Somehow in the last days the native-run (or adb, not completly sure) stopped working, either for livereloading or not, when using android platform. livereload still works on ios

Command Output:

this is the latest step of a ionic capacitor run android --debug --verbose --info, I hope it helps. The project itself was a newly generated app with ionic start, followed by a ionic add android.

[capacitor] ✔ Running Gradle build in 1.80s
[capacitor] 2024-04-11T12:58:45.471Z capacitor:android:run Invoking native-run with args: [
[capacitor]   'android',
[capacitor]   '--app',
[capacitor]   '/Users/waltercruz/devel/adb-test/android/app/build/outputs/apk/debug/app-debug.apk',
[capacitor]   '--target',
[capacitor]   'Pixel_7_API_33'
[capacitor] ]
[capacitor] ✖ Deploying app-debug.apk to Pixel_7_API_33 - failed!
[capacitor] [error] 2024-04-11T12:58:45.582Z native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME
[capacitor]         2024-04-11T12:58:45.583Z native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_SDK_ROOT
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveSDKRoot Using $ANDROID_SDK_ROOT at /Users/waltercruz/Library/Android/sdk
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveEmulatorHome Looking at $HOME/.android
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at /Users/waltercruz/.android
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveAVDHome Looking at $HOME/.android/avd
[capacitor]         2024-04-11T12:58:45.584Z native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at /Users/waltercruz/.android/avd
[capacitor]         2024-04-11T12:58:45.586Z native-run:android:utils:adb:getDevices Invoking adb with args: [ 'devices', '-l' ]
[capacitor]         2024-04-11T12:58:45.586Z native-run:android:utils:sdk:getSDKPackage Parsing /Users/waltercruz/Library/Android/sdk/platform-tools/package.xml
[capacitor]         2024-04-11T12:58:45.612Z native-run:android:utils:adb:parseAdbDevices Parsing adb devices from output lines: [
[capacitor]         'List of devices attached',
[capacitor]         'emulator-5554          device product:sdk_gphone64_x86_64 model:sdk_gphone64_x86_64 device:emu64x transport_id:1',
[capacitor]         'emulator-5562          offline transport_id:2',
[capacitor]         '',
[capacitor]         ''
[capacitor]         ]
[capacitor]         2024-04-11T12:58:45.612Z native-run:android:utils:adb:getDeviceProperties Invoking adb with args: [ '-s', 'emulator-5554', 'shell', 'getprop' ]
[capacitor]         2024-04-11T12:58:45.612Z native-run:android:utils:adb:getDeviceProperties Invoking adb with args: [ '-s', 'emulator-5562', 'shell', 'getprop' ]
[capacitor]         ADBs is unresponsive after 5000ms, killing server and retrying...
[capacitor]         2024-04-11T12:58:50.615Z native-run:android:utils:adb:execAdb ADB timeout of 5000 reached, killing server and retrying...
[capacitor]         2024-04-11T12:58:50.615Z native-run:android:utils:adb:execAdb Invoking adb with args: [ 'kill-server' ]
[capacitor]         2024-04-11T12:58:50.633Z native-run:android:utils:adb:execAdb Invoking adb with args: [ 'start-server' ]
[capacitor]         2024-04-11T12:58:53.673Z native-run:android:utils:adb:execAdb Retrying...
[capacitor]         2024-04-11T12:58:56.716Z native-run Caught fatal error: Error: Command failed: /Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop
[capacitor]         * daemon not running; starting now at tcp:5037
[capacitor]         * daemon started successfully
[capacitor]         adb: device offline
[capacitor]
[capacitor]         at genericNodeError (node:internal/errors:984:15)
[capacitor]         at wrappedFn (node:internal/errors:538:14)
[capacitor]         at ChildProcess.exithandler (node:child_process:422:12)
[capacitor]         at ChildProcess.emit (node:events:518:28)
[capacitor]         at maybeClose (node:internal/child_process:1105:16)
[capacitor]         at Socket.<anonymous> (node:internal/child_process:457:11)
[capacitor]         at Socket.emit (node:events:518:28)
[capacitor]         at Pipe.<anonymous> (node:net:337:12) {
[capacitor]         code: 1,
[capacitor]         killed: false,
[capacitor]         signal: null,
[capacitor]         cmd: '/Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop',
[capacitor]         stdout: '',
[capacitor]         stderr: '* daemon not running; starting now at tcp:5037\n' +
[capacitor]         '* daemon started successfully\n' +
[capacitor]         'adb: device offline\n'
[capacitor]         }
[capacitor]         Error: Command failed: /Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop
[capacitor]         * daemon not running; starting now at tcp:5037
[capacitor]         * daemon started successfully
[capacitor]         adb: device offline
[capacitor]
[capacitor]         at genericNodeError (node:internal/errors:984:15)
[capacitor]         at wrappedFn (node:internal/errors:538:14)
[capacitor]         at ChildProcess.exithandler (node:child_process:422:12)
[capacitor]         at ChildProcess.emit (node:events:518:28)
[capacitor]         at maybeClose (node:internal/child_process:1105:16)
[capacitor]         at Socket.<anonymous> (node:internal/child_process:457:11)
[capacitor]         at Socket.emit (node:events:518:28)
[capacitor]         at Pipe.<anonymous> (node:net:337:12)
[capacitor]
[ERROR] An error occurred while running subprocess capacitor.

        capacitor run android --target Pixel_7_API_33 exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +0ms
  ionic:utils-process processExit: exiting (exit code: 1) +31ms

SDK Info:

SDK Location:         /Users/waltercruz/Library/Android/sdk
AVD Home:             /Users/waltercruz/.android/avd

API Level:            34x
Packages:             Android SDK Platform 34-ext10  platforms;android-34-ext10  1
                      Android SDK Platform 34-ext8  platforms;android-34-ext8  1

API Level:            34
Packages:             Android SDK Platform 34  platforms;android-34  3
                      Sources for Android 34  sources;android-34  2

API Level:            33x
Packages:             Android SDK Platform 33-ext4  platforms;android-33-ext4  1
                      Android SDK Platform 33-ext5  platforms;android-33-ext5  1

API Level:            33
Packages:             Android SDK Platform 33  platforms;android-33  3
                      Google Play Intel x86_64 Atom System Image  system-images;android-33;google_apis_playstore;x86_64  7
                      Sources for Android 33  sources;android-33  1

API Level:            28
Packages:             Android SDK Platform 28  platforms;android-28  6

Tools:

Android Emulator  emulator  34.1.20
Android SDK Build-Tools 30.0.3  build-tools;30.0.3  30.0.3
Android SDK Build-Tools 33  build-tools;33.0.0  33.0.0
Android SDK Build-Tools 33.0.1  build-tools;33.0.1  33.0.1
Android SDK Build-Tools 33.0.2  build-tools;33.0.2  33.0.2
Android SDK Build-Tools 33.0.3  build-tools;33.0.3  33.0.3
Android SDK Build-Tools 34  build-tools;34.0.0  34.0.0
Android SDK Platform-Tools 34.0.5  platform-tools  34.0.5
Android SDK Tools  tools  26.1.1
SDK Patch Applier v4  patcher;v4  1
waltercruz commented 1 month ago

the output of ./node_modules/.bin/native-run android --app /Users/waltercruz/devel/adb-test/android/app/build/outputs/apk/debug/app-debug.apk --target Pixel_7_API_33 --verbose

  adb-test (main) ✗)./node_modules/.bin/native-run android --app /Users/waltercruz/devel/adb-test/android/app/build/outputs/apk/debug/app-debug.apk --target Pixel_7_API_33 --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 Using $ANDROID_SDK_ROOT at /Users/waltercruz/Library/Android/sdk +1ms
  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/waltercruz/.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/waltercruz/.android/avd +0ms
  native-run:android:utils:adb:getDevices Invoking adb with args: [ 'devices', '-l' ] +0ms
  native-run:android:utils:sdk:getSDKPackage Parsing /Users/waltercruz/Library/Android/sdk/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',
  native-run:android:utils:adb:parseAdbDevices   'emulator-5554          device product:sdk_gphone64_x86_64 model:sdk_gphone64_x86_64 device:emu64x transport_id:1',
  native-run:android:utils:adb:parseAdbDevices   'emulator-5562          offline transport_id:31',
  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 with args: [ '-s', 'emulator-5554', 'shell', 'getprop' ] +0ms
  native-run:android:utils:adb:getDeviceProperties Invoking adb with args: [ '-s', 'emulator-5562', 'shell', 'getprop' ] +0ms
ADBs is unresponsive after 5000ms, killing server and retrying...
  native-run:android:utils:adb:execAdb ADB timeout of 5000 reached, killing server and retrying... +0ms
  native-run:android:utils:adb:execAdb Invoking adb with args: [ 'kill-server' ] +0ms
  native-run:android:utils:adb:execAdb Invoking adb with args: [ 'start-server' ] +18ms
  native-run:android:utils:adb:execAdb Retrying... +3s
  native-run Caught fatal error: Error: Command failed: /Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop
  native-run * daemon not running; starting now at tcp:5037
  native-run * daemon started successfully
  native-run adb: device offline
  native-run
  native-run     at genericNodeError (node:internal/errors:984:15)
  native-run     at wrappedFn (node:internal/errors:538:14)
  native-run     at ChildProcess.exithandler (node:child_process:422:12)
  native-run     at ChildProcess.emit (node:events:518:28)
  native-run     at maybeClose (node:internal/child_process:1105:16)
  native-run     at Socket.<anonymous> (node:internal/child_process:457:11)
  native-run     at Socket.emit (node:events:518:28)
  native-run     at Pipe.<anonymous> (node:net:337:12) {
  native-run   code: 1,
  native-run   killed: false,
  native-run   signal: null,
  native-run   cmd: '/Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop',
  native-run   stdout: '',
  native-run   stderr: '* daemon not running; starting now at tcp:5037\n' +
  native-run     '* daemon started successfully\n' +
  native-run     'adb: device offline\n'
  native-run } +0ms
Error: Command failed: /Users/waltercruz/Library/Android/sdk/platform-tools/adb -s emulator-5562 shell getprop
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb: device offline

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12)
waltercruz commented 1 month ago

ok, it seems that Ventura 13.6.6 broke something.

Someone with that version of Ventura that wanna help me confirm?