-
-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Environment
- CLI: 7.0.12
- Windows Subsystem for Linux (WSL2)
Details
After running tns run android
, the app compiles properly but not hot reloading. Got an error:
Unable to apply changes on device: emulator-5554. Error is: connect ECONNREFUSED 127.0.0.1:40547
After using --log trace
, found that port 40547 (changes every run), in this particular run, is related to livesync, maybe.
spawn: /home/user/android/platform-tools/adb "-s" "emulator-5554" "forward" "tcp:40547" "localabstract:org.nativescript.application-livesync"
Result when throw error is false:
{ stdout: '40547\n', stderr: '', exitCode: 0 }
spawn: /home/user/android/platform-tools/adb "-s" "emulator-5554" "shell" "rm" "-rf" "/data/local/tmp/org.nativescript.application-livesync-in-progress"
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 0 }
Unable to apply changes on device: emulator-5554. Error is: connect ECONNREFUSED 127.0.0.1:40547.
Error: connect ECONNREFUSED 127.0.0.1:40547
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 40547
}
Will emit event runOnDeviceError with data {
projectDir: '/home/user/code/vue-ns',
deviceIdentifier: 'emulator-5554',
applicationIdentifier: 'org.nativescript.application',
error: Error: connect ECONNREFUSED 127.0.0.1:40547
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 40547
}
}
Stopping webpack watch for platform android.
Webpack process exited with code null when we expected it to be long living with watch.
To Reproduce
tns run android
Expected behavior
Hot Reload.
Additional context
Trying to setup nativescript-vue in windows wsl2. Made it to work. It compiles correctly. For reference, I used the following write-ups/articles to set it up.
I only used the basic app template from vue init nativescript-vue/vue-cli-template
.
tns doctor
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.0.12 version and is up to date.
✔ Component @nativescript/core has 7.0.13 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 7.0.1 version and is up to date.
I've already searched google looking for answers. I found same error asked in stackoverflow but there are no answers and their question has no details/context behind it, so I'm not sure if they really have the same issue as this.
Not sure if this is a WSL2 specific problem with ports. If it is, I hope someone could point me in the right direction on how to solve this. Thanks