NativeScript/nativescript-cli

Unable to apply changes on device: 1633183f. Error is: Invalid Version: null.

mannok opened this issue · 2 comments

Issue Description

I have tested for the new nativescript-vue3 and find that I could not run in Android device with the error message Unable to apply changes on device: 1633183f. Error is: Invalid Version: null.

Provided execution log as follow

Searching for devices...
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.

webpack is watching the files...
asset vendor.js 7.45 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
asset runtime.js 87.3 KiB [compared for emit] (name: runtime)
asset bundle.js 80.7 KiB [compared for emit] (name: bundle)
Entrypoint bundle 7.62 MiB = runtime.js 87.3 KiB vendor.js 7.45 MiB bundle.js 80.7 KiB
runtime modules 25 KiB 12 modules
orphan modules 302 bytes [orphan] 5 modules
modules by path ./node_modules/ 2.8 MiB 349 modules
modules by path ./src/ 25.5 KiB
  modules by path ./src/components/*.vue 12.8 KiB
    ./src/components/Home.vue 907 bytes [built] [code generated]
    ./src/components/Home.vue?vue&type=template&id=8dc7cce2&ts=true 415 bytes [built] [code generated]
    ./src/components/Home.vue?vue&type=script&lang=ts&setup=true 628 bytes [built] [code generated]
    ./src/components/Home.vue?vue&type=style&index=0&id=8dc7cce2&lang=css 922 bytes [built] [code generated]
    ./node_modules/@nativescript/webpack/dist/loaders/nativescript-worker-loader/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-3.use[0]!./node_modules/nativescript-vue/node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/nativescript-vue/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Ho                ome.vue?vue&type=template&id=8dc7cce2&ts=true 2.68 KiB [built] [code generated]
    ./node_modules/@nativescript/webpack/dist/loaders/nativescript-worker-loader/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-3.use[0]!./node_modules/nativescript-vue/node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Home.vue?vue&type=script&lang=ts&setup=true 1.15 KiB [built] [code generated]
    + 6 modules
  ./src/app.ts 3.79 KiB [built] [code generated]
  ./src/app.css 8.96 KiB [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.75.0 compiled successfully in 8909 ms
Webpack compilation complete. Watching for file changes.
Type-checking in progress...
Updating runtime package.json with configuration values...
File change detected. Starting incremental webpack compilation...
Project successfully prepared (android)
Building project...
Gradle build...
assets by status 7.62 MiB [cached] 3 assets
Entrypoint bundle 7.62 MiB = runtime.js 87.3 KiB vendor.js 7.45 MiB bundle.js 80.7 KiB
cached modules 2.82 MiB (javascript) 25 KiB (runtime) [cached] 380 modules
./src/app.css 8.96 KiB [built]
webpack 5.75.0 compiled successfully in 714 ms
Webpack compilation complete. Watching for file changes.
Type-checking in progress...
No errors found.
         + applying user-defined configuration from C:\projects\self\ns-helloworld\App_Resources\Android\before-plugins.gradle
         + applying user-defined configuration from C:\projects\self\ns-helloworld\App_Resources\Android\before-plugins.gradle
         + setting applicationId
         + applying user-defined configuration from C:\projects\self\ns-helloworld\App_Resources\Android\app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: C:\projects\self\ns-helloworld\node_modules\@nativescript\core\platforms\android\core.aar
         + adding aar plugin dependency: C:\projects\self\ns-helloworld\node_modules\@nativescript\core\platforms\android\widgets-release.aar
Project successfully built.
Build time: 37.939 s.
The build result is located at: C:\projects\self\ns-helloworld\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Installing on device 1633183f...
Successfully installed on device with identifier '1633183f'.
Unable to apply changes on device: 1633183f. Error is: Invalid Version: null.

package.json

{
  "name": "ns-helloworld",
  "main": "src/app.ts",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@nativescript/core": "~8.4.0",
    "nativescript-vue": "3.0.0-beta.2"
  },
  "devDependencies": {
    "@nativescript/android": "^8.4.0",
    "@nativescript/tailwind": "^2.0.1",
    "@nativescript/types": "~8.4.0",
    "@nativescript/webpack": "~5.0.0",
    "@types/node": "~17.0.21",
    "nativescript": "^8.4.0",
    "tailwindcss": "^3.1.8",
    "typescript": "~4.8.4",
    "vue": "^3.2.45"
  }
}

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.
✔ 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 8.4.0 version and is up to date.
✔ Component @nativescript/core has 8.4.1 version and is up to date.
✖ Component @nativescript/ios is not installed.
✔ Component @nativescript/android has 8.4.0 version and is up to date.

Any help would be so much appreciate. Thanks

Reproduction

No response

Relevant log output (if applicable)

No response

Environment

No response

Please accept these terms

Try changing "@nativescript/android": "^8.4.0", to "@nativescript/android": "8.4.0", (remove the ^)

- "@nativescript/android": "^8.4.0",
+ "@nativescript/android": "8.4.0",

It's a bug in the CLI, which I believe to have handled in the past, but looks like not working in all cases yet...

@rigor789 works. Thanks!