Open twopelu opened 3 years ago
Same happened to me.
ns doctor
shows no error.
$ ns doctor
✔ Getting environment information
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.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.4.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.2 version and is up to date.
✔ Component @nativescript/core has 8.0.5 version and is up to date.
✔ Component @nativescript/ios has ~8.0.0 version and is up to date.
✔ Component @nativescript/android has ~8.0.0 version and is up to date.
@twopelu Here is my workaround.
~
or ^
from version expressions in the package.jsonbefore (NOT WORKED)
"@nativescript/android": "~8.0.0",
"@nativescript/ios": "~8.0.0",
after (WORKED)
"@nativescript/android": "8.0.0",
"@nativescript/ios": "8.0.0",
Seems NativeScript CLI cannot launch API 30 devices. I created new virtual device which uses API 29 and it works perfectly.
Hi, I have the same issue, any solutions?
@kiyavash post your package.json
add package.json :
{
"nativescript": {
"id": {
"ios": "org.nativescript.appidios",
"android": "org.nativescript.appidandroid"
},
"tns-android": {
"version": "*"
},
"tns-ios": {
"version": "*"
}
},
.........
}
Hi, I am experiencing a similar error, but instead of "invalid version" I am getting "Must be String. Got type 'object'" Even though the version is "^8.8.2" I also tried the fix mentioned in this issue within
package.json`.
Successfully installed on device with identifier 'emulator-5554'.
Could not find an installed runtime, falling back to default runtimes
Could not find an installed runtime, falling back to default runtimes
Could not find an installed runtime, falling back to default runtimes
Unable to apply changes on device: emulator-5554. Error is: Invalid version. Must be a string. Got type "object"..
TypeError: Invalid version. Must be a string. Got type "object".
at new SemVer (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/classes/semver.js:19:13)
at compare (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/functions/compare.js:3:3)
at Object.gt (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/functions/gt.js:2:29)
at AndroidLiveSyncService._getDeviceLiveSyncService (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/android-livesync-service.js:34:20)
at AndroidLiveSyncService.getDeviceLiveSyncService (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:42:59)
at AndroidLiveSyncService.<anonymous> (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:79:48)
at Generator.next (<anonymous>)
at /Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:14:71
at new Promise (<anonymous>)
at __awaiter (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:10:12)
Will emit event runOnDeviceError with data {
projectDir: '/Users/hsunatal/Projects/ibd-ns-latest',
deviceIdentifier: 'emulator-5554',
applicationIdentifier: 'org.nativescript.ibdnslatest',
error: TypeError: Invalid version. Must be a string. Got type "object".
at new SemVer (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/classes/semver.js:19:13)
at compare (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/functions/compare.js:3:3)
at Object.gt (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/node_modules/semver/functions/gt.js:2:29)
at AndroidLiveSyncService._getDeviceLiveSyncService (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/android-livesync-service.js:34:20)
at AndroidLiveSyncService.getDeviceLiveSyncService (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:42:59)
at AndroidLiveSyncService.<anonymous> (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:79:48)
at Generator.next (<anonymous>)
at /Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:14:71
at new Promise (<anonymous>)
at __awaiter (/Users/hsunatal/.nvm/versions/node/v20.15.1/lib/node_modules/nativescript/lib/services/livesync/platform-livesync-service-base.js:10:12)
}
Stopping webpack watch for platform android.
Project dir from hooksArgs is: /Users/hsunatal/Projects/ibd-ns-latest.
AfterHookName for command watch is after-watch
Will emit event runOnDeviceStopped with data {
projectDir: '/Users/hsunatal/Projects/ibd-ns-latest',
deviceIdentifier: 'emulator-5554',
keepProcessAlive: undefined
}
Webpack process exited with code null when we expected it to be long living with watch.
Environment
Windows 10 + Android
Describe the bug
When I run the command
ns run android
to launch the app in a virtual device, the app is built and installed correctly, but it shows the error in console:Unable to apply changes on device: emulator-5554. Error is: Invalid Version: ~8.0.0.
I have checked that the app is installed in the virtual device and if I open it manually it works properly, it seems the problem only affects to hot-reload of changes.
See complete log of run command:
To Reproduce
Expected behavior
The expected behaviour would be to not see any errors in console and have hot-reaload of changes in the virtual device.
Sample project
I'm following the NativeScript Tutorial, the project has been created with the command
ns create NativeScriptAngularExample --angular
and there are no changes in the project except adding the dev dependency "@nativescript/android": "~8.0.0" as per documentation.https://docs.nativescript.org/environment-setup.html#windows-android
I have checked my setup is correct by running the doctor.
See complete log of doctor command:
Additional context
See configuration of the Android SDK and AVD:
Please let me know if you need any further information. Thanks in advance!