Open adrian-niculescu opened 2 years ago
Retested this after NativeScript CLI 8.2.2 was released
ns create MyApp --ts
cd MyApp
npm install
ns platform add ios
ns platform add android
ns platform update ios
ns platform update android
ns test init --framework=mocha
ns test android --emulator --justlaunch
still does not work out-of-the-box, but after adding "@nativescript/android": "^8.2.2",
to devDependencies
in package.json
it worked
Current working environment (after manual adjustments):
echo 'y' | npx nativescript-envinfo
OS: macOS 11.5.2
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Shell: /bin/bash
node: 16.14.0
npm: 8.5.1
nativescript: 8.2.2
# android
java: 11.0.11
ndk: Not Found
apis: 29, 30, 31, 32
build_tools: 29.0.2, 29.0.3, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0
system_images:
- android-23 | Google APIs Intel x86 Atom_64
- android-24 | Google APIs Intel x86 Atom_64
- android-24 | Google Play Intel x86 Atom
- android-25 | Google APIs Intel x86 Atom_64
- android-26 | Google APIs Intel x86 Atom_64
- android-27 | Google APIs Intel x86 Atom
- android-28 | Google Play Intel x86 Atom_64
- android-29 | Google Play Intel x86 Atom_64
- android-30 | Google Play Intel x86 Atom_64
- android-31 | Google Play Intel x86 Atom_64
- android-32 | Google Play Intel x86 Atom_64
# ios
xcode: 12.5.1/12E507
cocoapods: 1.11.2
python: 2.7.16
python3: 3.9.10
ruby: 3.1.1
platforms:
- iOS 14.5
- DriverKit 20.4
- macOS 11.3
- tvOS 14.5
- watchOS 7.4
"dependencies": {
"@nativescript/core": "~8.2.0",
"@nativescript/theme": "~3.0.2",
"@nativescript/unit-test-runner": "^3.0.2"
},
"devDependencies": {
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@nativescript/android": "^8.2.2",
"@nativescript/ios": "8.2.1",
"@nativescript/types": "~8.2.0",
"@nativescript/webpack": "~5.0.6",
"@types/karma-chai": "0.1.2",
"@types/mocha": "9.1.0",
"chai": "4.3.6",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-coverage": "2.2.0",
"karma-mocha": "2.0.1",
"karma-nativescript-launcher": "0.4.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"typescript": "~4.5.5"
}
ns create myTestApp --ts
cd myTestApp
ns test init --framework=mocha
ns test android --emulator --justlaunch
These work for me - the only change I had to make (which I'm fixing in the default karma config) was to add hostname: '127.0.0.1'
because in node17 localhost
get's resolved to the ipv6 address by default, and causes the following error:
Error: connect ECONNREFUSED ::1:9876
Using 127.0.0.1
forces it to use ipv4...
Committed the fix here - will publish along with other fixes later... https://github.com/NativeScript/nativescript-cli/commit/81cb9c37cdd4e24115be79b24b68dfbaf8cdcfd2
Ran:
ns create myTestApp --ts
cd myTestApp
ns test init --framework=mocha
ns test android --emulator --justlaunch
with the following error:
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: Invalid Version: null.
Full logs
$ ns test android --emulator --justlaunch
Searching for devices...
14 03 2022 16:24:21.307:WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(configFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead.
14 03 2022 16:24:21.628:INFO [karma-server]: Karma v6.3.17 server started at http://localhost:9876/
14 03 2022 16:24:21.628:INFO [launcher]: Launching browsers android with concurrency unlimited
14 03 2022 16:24:21.632:INFO [launcher]: Starting browser NativeScript Unit Test Runner
Copying template files...
Platform android successfully added. v7.0.1
Preparing project...
Using @nativescript/android which requires nsconfig.json to be present.
Writing nsconfig.json based on the values set in nativescript.config.(js|ts).
You may add nsconfig.json to .gitignore as the CLI will regenerate it as necessary.
resolving "./stop-process.js" to "./stop-process.android.js"
asset vendor.js 6.45 MiB [emitted] (name: vendor) (id hint: defaultVendor)
asset bundle.js 18.8 KiB [emitted] (name: bundle)
asset runtime.js 11.6 KiB [emitted] (name: runtime)
Entrypoint bundle 6.48 MiB = runtime.js 11.6 KiB vendor.js 6.45 MiB bundle.js 18.8 KiB
runtime modules 2.46 KiB 7 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/@nativescript/ 1.51 MiB 208 modules
modules by path ./node_modules/css-tree/ 317 KiB 113 modules
modules by path ./node_modules/source-map/lib/*.js 36.3 KiB 6 modules
modules by path ./node_modules/reduce-css-calc/dist/ 131 KiB 5 modules
modules by path ./node_modules/postcss-value-parser/lib/*.js 12.5 KiB 5 modules
modules by path ./app/ 693 bytes
./app/test.ts 206 bytes [built] [code generated]
+ 2 modules
modules by path ./node_modules/mdn-data/css/*.json 242 KiB
./node_modules/mdn-data/css/at-rules.json 11.6 KiB [built] [code generated]
+ 2 modules
+ 4 modules
webpack 5.70.0 compiled successfully in 5251 ms
Webpack compilation complete.
(node:13265) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/adriann/Developer/SANDBOX/myTestApp/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
~ applying user-defined configuration from /Users/adriann/Developer/SANDBOX/myTestApp/App_Resources/Android/before-plugins.gradle
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Built aar for @nativescript/core
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Building project...
Gradle build...
+ setting applicationId
+ applying user-defined configuration from /Users/adriann/Developer/SANDBOX/myTestApp/App_Resources/Android/before-plugins.gradle
+ applying user-defined configuration from /Users/adriann/Developer/SANDBOX/myTestApp/App_Resources/Android/app.gradle
+ using android X library androidx.legacy:legacy-support-v4:1.0.0
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: /Users/adriann/Developer/SANDBOX/myTestApp/node_modules/@nativescript/core/platforms/android/core.aar
+ adding aar plugin dependency: /Users/adriann/Developer/SANDBOX/myTestApp/node_modules/@nativescript/core/platforms/android/widgets-release.aar
+ adding aar plugin dependency: /Users/adriann/Developer/SANDBOX/myTestApp/node_modules/@nativescript/unit-test-runner/platforms/android/unit_test_runner.aar
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Project successfully built.
Build time: 40.653 s.
The build result is located at: /Users/adriann/Developer/SANDBOX/myTestApp/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Unable to apply changes on device: emulator-5554. Error is: Invalid Version: null.
Environment
echo 'y' | npx nativescript-envinfo
OS: macOS 11.5.2
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Shell: /bin/bash
node: 16.14.0
npm: 8.5.1
nativescript: 8.2.2
# android
java: 11.0.11
ndk: Not Found
apis: 29, 30, 31, 32
build_tools: 29.0.2, 29.0.3, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0
system_images:
- android-23 | Google APIs Intel x86 Atom_64
- android-24 | Google APIs Intel x86 Atom_64
- android-24 | Google Play Intel x86 Atom
- android-25 | Google APIs Intel x86 Atom_64
- android-26 | Google APIs Intel x86 Atom_64
- android-27 | Google APIs Intel x86 Atom
- android-28 | Google Play Intel x86 Atom_64
- android-29 | Google Play Intel x86 Atom_64
- android-30 | Google Play Intel x86 Atom_64
- android-31 | Google Play Intel x86 Atom_64
- android-32 | Google Play Intel x86 Atom_64
# ios
xcode: 12.5.1/12E507
cocoapods: 1.11.2
python: 2.7.16
python3: 3.9.10
ruby: 3.1.1
platforms:
- iOS 14.5
- DriverKit 20.4
- macOS 11.3
- tvOS 14.5
- watchOS 7.4
"dependencies": {
"@nativescript/core": "~8.2.0",
"@nativescript/theme": "~3.0.2",
"@nativescript/unit-test-runner": "^3.0.2"
},
"devDependencies": {
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@nativescript/types": "~8.2.0",
"@nativescript/webpack": "~5.0.6",
"@types/karma-chai": "0.1.2",
"@types/mocha": "9.1.0",
"chai": "4.3.6",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-coverage": "2.2.0",
"karma-mocha": "2.0.1",
"karma-nativescript-launcher": "0.4.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"typescript": "~4.5.5"
}
Using
"dependencies": {
"@nativescript/core": "~8.2.1",
"@nativescript/theme": "~3.0.2",
"@nativescript/unit-test-runner": "^3.0.2"
},
"devDependencies": {
"@nativescript/android": "~8.1.1",
"@nativescript/ios": "~8.2.1",
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@nativescript/types": "~8.2.0",
"@nativescript/webpack": "~5.0.6",
"@types/karma-chai": "0.1.3",
"@types/mocha": "9.1.0",
"chai": "4.3.6",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-coverage": "2.2.0",
"karma-mocha": "2.0.1",
"karma-nativescript-launcher": "0.4.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"typescript": "~4.5.5"
}
then
ns test android --emulator --justlaunch
works as expected.
Observed discrepancies:
@nativescript/android
version 7.0.1@nativescript/android
is not added by the NativeScript CLI to package.json
ns platform update android
does upgrade the project to use @nativescript/android@8.2.2
but I have the same error with this version.@nativescript/android@8.1.1
-> works as expected.by default NativeScript CLI 8.2.2 uses @nativescript/android version 7.0.1
That's strange - seems like an npm cache issue locally? It uses latest 8.2.2 for me as expected.
@nativescript/android is not added by the NativeScript CLI to package.json
Not after ns create
but after running the app first - it should be added automatically ("@nativescript/android": "8.2.2"
)
ns platform update android does upgrade the project to use @nativescript/android@8.2.2 but I have the same error with this version.
Check package.json
- ~8.2.2
should work, but try with just 8.2.2
without the tilde and see if that makes a difference? The Invalid Version: null.
usually meant an unparsable version number somewhere, though I fixed many cases like that in the CLI, and I haven't seen that pop up for a while now. You can run with --log trace
to get a stack-trace of where that's coming from, might help me fix it in the cli.
downgrading to @nativescript/android@8.1.1 -> works as expected.
Does that mean no ~
(tilde) in the version? Might be related to above?
Running the same exact commands:
ns create myTestApp --ts
cd myTestApp
ns test init --framework=mocha
ns test android --emulator --justlaunch
Yields this on both my mac and windows machines:
$ ns test android --emulator --justlaunch
Searching for devices...
Starting Android emulator with image Pixel_3_XL_API_30
Waiting for emulator device initialization...
14 03 2022 16:02:15.275:WARN [karma-server]: Passing raw CLI options to `new Server(config, done)` is deprecated. Use `parseConfig(configFilePath, cliOptions, {promiseConfig: true, throwErrors: true})` to prepare a processed `Config` instance and pass that as the `config` argument instead.
14 03 2022 16:02:17.144:INFO [karma-server]: Karma v6.3.17 server started at http://127.0.0.1:9876/
14 03 2022 16:02:17.144:INFO [launcher]: Launching browsers android with concurrency unlimited
14 03 2022 16:02:17.151:INFO [launcher]: Starting browser NativeScript Unit Test Runner
Copying template files...
Platform android successfully added. v8.2.2
Preparing project...
resolving "./stop-process.js" to "./stop-process.android.js"
asset vendor.js 6.45 MiB [emitted] (name: vendor) (id hint: defaultVendor)
asset bundle.js 18.7 KiB [emitted] (name: bundle)
asset runtime.js 11.6 KiB [emitted] (name: runtime)
Entrypoint bundle 6.48 MiB = runtime.js 11.6 KiB vendor.js 6.45 MiB bundle.js 18.7 KiB
runtime modules 2.46 KiB 7 modules
orphan modules 356 bytes [orphan] 6 modules
modules by path ./node_modules/@nativescript/ 1.51 MiB 208 modules
modules by path ./node_modules/css-tree/ 317 KiB 113 modules
modules by path ./node_modules/source-map/lib/*.js 36.3 KiB 6 modules
modules by path ./node_modules/reduce-css-calc/dist/ 131 KiB 5 modules
modules by path ./node_modules/postcss-value-parser/lib/*.js 12.5 KiB 5 modules
modules by path ./app/ 709 bytes
./app/test.ts 213 bytes [built] [code generated]
+ 2 modules
modules by path ./node_modules/mdn-data/css/*.json 242 KiB
./node_modules/mdn-data/css/at-rules.json 11.6 KiB [built] [code generated]
+ 2 modules
+ 4 modules
webpack 5.70.0 compiled successfully in 5551 ms
Webpack compilation complete.
(node:19592) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
~ applying user-defined configuration from C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\App_Resources\Android\before-plugins.gradle
Built aar for @nativescript/core
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Building project...
Gradle build...
+ applying user-defined configuration from C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\App_Resources\Android\before-plugins.gradle
+ setting applicationId
+ applying user-defined configuration from C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\App_Resources\Android\before-plugins.gradle
+ applying user-defined configuration from C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\App_Resources\Android\app.gradle
+ adding nativescript runtime package dependency: nativescript-optimized-with-inspector
+ adding aar plugin dependency: C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\node_modules\@nativescript\core\platforms\android\core.aar
+ adding aar plugin dependency: C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\node_modules\@nativescript\core\platforms\android\widgets-release.aar
+ adding aar plugin dependency: C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\node_modules\@nativescript\unit-test-runner\platforms\android\unit_test_runner.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Project successfully built.
Build time: 39.315 s.
The build result is located at: C:\Users\rigor789\Documents\Code\_tmp\8.2\myTestApp\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Installing on device emulator-5554...
Successfully installed on device with identifier 'emulator-5554'.
Restarting application on device emulator-5554...
Successfully synced application org.nativescript.myTestApp on device emulator-5554.
14 03 2022 16:03:41.155:INFO [undefined 0.0.0 (Android SDK)]: Connected on socket -87QqhCv3jHrZuAdAAAB with id NativeScriptUnit-8586
undefined 0.0.0 (Android SDK): Executed 1 of 1 SUCCESS (0.056 secs / 0.001 secs)
TOTAL: 1 SUCCESS
14 03 2022 16:03:42.067:WARN [undefined 0.0.0 (Android SDK)]: Disconnected (0 times) Client disconnected from CONNECTED undefined 0.0.0 (Android SDK) ERROR
Disconnected Client disconnected from CONNECTED state (server shutting down)
undefined 0.0.0 (Android SDK): Executed 1 of 1 SUCCESS (0.056 secs / 0.001 secs)
I cleared the npm cache via
rm -rf ~/.npm/_cacache
(I have npm installed via nvm
then:
ns create myTestApp --ts
cd myTestApp
ns test init --framework=mocha
ns run android
by default NativeScript CLI 8.2.2 uses @NativeScript/android version 7.0.1
That's strange - seems like an npm cache issue locally? It uses latest 8.2.2 for me as expected.
ns test android --emulator --justlaunch # OR ns run android
Searching for devices...
Copying template files...
Platform android successfully added. v7.0.1
It says it adds the 7.0.1 version not 8.2.2. ⚠️
also tried:
ns platform add android
Platform android already added
ns platform update android
Gradle stop services...
Platform android successfully removed.
Copying template files...
Platform android successfully added. v7.0.1
Successfully updated to version 8.2.2
I checked to see if @nativescript/android
is installed:
ls node_modules/@nativescript/android
ls: node_modules/@nativescript/android: No such file or directory
So that's the real problem ⚠️
@NativeScript/android is not added by the NativeScript CLI to package.json
Not after
ns create
but after running the app first - it should be added automatically ("@nativescript/android": "8.2.2"
)after
ns test android --emulator --justlaunch # ns run android
I still don't see
@nativescript/android
inpackage.json
or innode_modules
(seems like a CLI issue) ⚠️ns platform update android does upgrade the project to use @NativeScript/android@8.2.2 but I have the same error with this version.
Check
package.json
-~8.2.2
should work, but try with just8.2.2
without the tilde and see if that makes a difference? TheInvalid Version: null.
usually meant an unparsable version number somewhere, though I fixed many cases like that in the CLI, and I haven't seen that pop up for a while now. You can run with--log trace
to get a stack-trace of where that's coming from, might help me fix it in the cli. Ok, I put"@nativescript/android": "~8.2.2",
inpackage.json
as advised; thennpm install @nativescript/android --save-dev ns clean; npm install; ns test android --emulator --justlaunch
works 👍 I think I just needed a
ns clean; npm install
there. So this can be considered ok.
TL;DR The remaining issues are:
@nativescript/android
is not added automatically topackage.json
and not installed in node_modules
at ns test android --emulator --justlaunch
or ns run android
, leading to errors such as Invalid Version: null.
. -> workaround: npm install @nativescript/android --save-dev; ns clean; npm install
@nativescript/android
v 7.0.1 by default (but actually no version is installed).Unable to reproduce unfortunately - can you run with --log trace
and share the logs? Have no idea why it would pull in 7.0.1 either, unless you are on a 7.x CLI ns -v
?
ns -v
8.2.2
- Checking for updates...
✔ Up to date.
Logs for
ns test android --emulator --justlaunch --log trace
Reading the logs I've noticed errors that reference this directory
ls -alh ~/.local/share/.nativescript-cli/
total 288
drwxr-xr-x 8 adriann staff 256B Mar 14 22:34 .
drwxr-xr-x 5 adriann staff 160B Nov 5 18:52 ..
-rw-r--r-- 1 adriann staff 110K Mar 14 22:34 doctor-cache.json
-rw-r--r-- 1 adriann staff 8.7K Mar 3 09:45 should-migrate-cache-7.2.1.json
-rw-r--r-- 1 adriann staff 228B Sep 17 08:44 should-migrate-cache-8.1.2.json
-rw-r--r-- 1 adriann staff 7.1K Mar 9 09:44 should-migrate-cache-8.1.5.json
-rw-r--r-- 1 adriann staff 115B Mar 9 15:30 should-migrate-cache-8.2.1.json
-rw-r--r-- 1 adriann staff 1.3K Mar 14 21:26 should-migrate-cache-8.2.2.json
cat should-migrate-cache-8.2.2.json
{
"2e0fd9d73b055d5e341204f8093f6e4469d2f224a0b505dee681de86a57b850a": "a957c219c80192db22d323180cb7bed67ca120e6",
"ebb28abc612222b448e0778c143e0709e5676aa236438fca600ee72a015b4a57": "b7e4419b27ab5c9386b1b081af4f4b13f8f1c5f6",
"63f58b9b93ce97ac8ee99f8b335207086f36f2e4a3a9eacc0e7cd4ce2deb7f58": "d83c07b520620800e4ba450279ff6d6c7c77c379",
"3e6696a7156bcf9d3e3f327a07420a25bf3db42676711d9b39a5fa7ba144bbb3": "79b12920f4972fe569d917fab5997335f9947996",
"bbad8ca137524ea66b39a131007fbc1b67f8186895137daa77bcea1405fcf352": "ace098c6f4054f916836b5b90b60209a7c8bbb72",
"473ca51ff929e348e9c88ab66c70bcc2b2b51a092c03fa72edd45f56dd5a4a33": "b7e4419b27ab5c9386b1b081af4f4b13f8f1c5f6",
"17e11620c3e69b79d48c6ad7d059f8b363b969cb1e36e1e02980ef05cf8cce28": "8abf7f811b3e31f1bbe1726d77c334320ce89417",
"4eb61a6a1e137d69ac6c32433e67f290277e10eaa156f6c5990600424a4b02ed": "fd059d39b53ae0e2d1940dff6d0d8d4ab77da7ac",
"ede126d3a50023ecd7fa576a8311304188b00da6d1ecc7f6338a42b933b5a8dc": "cad66fa2b8f538dbe75b50e365458da80872edfc",
"7b036bf99b27cc193b83fe0ab11e9b5849b76a1d3ee7050ca795ee7de3349e15": "cad66fa2b8f538dbe75b50e365458da80872edfc",
"be9e30f0eba07ba3d7ab78da18798fa29e4328c2ca6a137ea16e37aa76f0985b": "75fb99132d0ee499d08e33c24c34a49354989b44",
"6225674723eb3d2bee4a08a15448319073b6ad3461315d77404f79a31813446d": "85a5a3754ef71e347e19091f147566ee1e3d32ce"
}
which I did not know existed and which was not affected by npm uninstall -g nativescript
. Do you think it's related?
Should I manually delete these files?
Delete /Users/adriann/.local/share/.nativescript-cli/user-settings.json
- that seems to be invalid too (likely unrelated, but good to clean stuff up to make sure)
I don't have the user-settings.json
file actually.
ls -alh ~/.local/share/.nativescript-cli/user-settings.json
ls: /Users/adriann/.local/share/.nativescript-cli/user-settings.json: No such file or directory
As indicated in my reply above:
ls -alh ~/.local/share/.nativescript-cli/
total 288
drwxr-xr-x 8 adriann staff 256B Mar 14 22:34 .
drwxr-xr-x 5 adriann staff 160B Nov 5 18:52 ..
-rw-r--r-- 1 adriann staff 110K Mar 14 22:34 doctor-cache.json
-rw-r--r-- 1 adriann staff 8.7K Mar 3 09:45 should-migrate-cache-7.2.1.json
-rw-r--r-- 1 adriann staff 228B Sep 17 08:44 should-migrate-cache-8.1.2.json
-rw-r--r-- 1 adriann staff 7.1K Mar 9 09:44 should-migrate-cache-8.1.5.json
-rw-r--r-- 1 adriann staff 115B Mar 9 15:30 should-migrate-cache-8.2.1.json
-rw-r--r-- 1 adriann staff 1.3K Mar 14 21:26 should-migrate-cache-8.2.2.json
cd ~/.local/share/.nativescript-cli
rm -rf *
and repeated the scenario; same error.
I could also replicate the "Invalid Version:null" problem.
ns create myTestApp --ts; cd myTestApp; ns test init --framework=mocha; ns test android --emulator --justlaunch
leads to
And I have:
`echo 'y' | npx nativescript-envinfo
OS: macOS 11.5.2
CPU: (8) x64 Apple M1
Shell: /bin/bash
node: 16.14.0
npm: 8.5.4
nativescript: 8.2.2
# android
java: 11.0.11
ndk: Not Found
apis: 24, 29, 30, 31, 32
build_tools: 29.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0
system_images:
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-32 | Google Play ARM 64 v8a
# ios
xcode: 12.5.1/12E507
cocoapods: 1.11.2
python: 2.7.16
python3: 3.9.10
ruby: 3.1.1
platforms:
- iOS 14.5
- DriverKit 20.4
- macOS 11.3
- tvOS 14.5
- watchOS 7.4
"dependencies": {
"@nativescript/core": "~8.2.0",
"@nativescript/theme": "~3.0.2",
"@nativescript/unit-test-runner": "^3.0.2"
},
"devDependencies": {
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@nativescript/types": "~8.2.0",
"@nativescript/webpack": "~5.0.6",
"@types/karma-chai": "0.1.2",
"@types/mocha": "9.1.0",
"chai": "4.3.6",
"karma": "6.3.17",
"karma-chai": "0.1.0",
"karma-coverage": "2.2.0",
"karma-mocha": "2.0.1",
"karma-nativescript-launcher": "0.4.0",
"mocha": "9.2.1",
"nyc": "15.1.0",
"typescript": "~4.5.5"
}
`
Can someone with an M1 run this command (@triniwiz @NathanWalker):
ns create myTestApp --ts; cd myTestApp; ns test init --framework=mocha; ns test android --emulator --justlaunch
Running echo 'y' | npx nativescript-envinfo
afterwards, shows the runtime in devDependencies
and everything works (tested on a windows10 and a macos 12.2.1 machine, same outcome)
I also tried with your version of the CLI
npm install -g nativescript@8.2.2-next-03-11-2022-1970936431
with the same error as before.
I'm using @next
only to use the 127.0.0.1
ip in the karma config since I'm on node 17 - otherwise it should be identical. Let see if anyone else with an M1 can run the above and report their results - I'm frankly out of ideas what could possibly be causing it to install old runtime, and not add it to package.json for you...
Thank you! Note that I am on using an Intel mac (Mac Mini 2018); @Andreea1998 is using M1 according to the env info.
I also tried to replicate your env more exactly
node --version
v17.6.0
npm --version
8.5.1
ns --version
8.2.2-next-03-11-2022-1970936431
with the same error as before.
Issue Description
Create an a new
TyepScript
app and initialize it for testing withmocha
. When running the tests there is an error that thekarma.conf.js
is missing.Reproduction
OR for iOS (same result):
Relevant log output (if applicable)
Environment
Environment Result of
echo 'y' | npx nativescript-envinfo
Dependencies
Please accept these terms