[NativeScript+Vue3] Error is: Invalid Version: null. 에러 해결

2023. 9. 18. 16:15IT/Vue

반응형

디바이스와 연결하여 디버깅을 한참 하고 있는데, 갑자기 Error is: Invalid Version: null. 이런 에러가 나면서 디버깅이 제대로 안되기 시작했다. 구글링을 해보니 안드로이드 앱 버전 0으로 설정되어 발생하는 에러라는데, 나의 경우는 package.json 에 버전이 잘 설정되어 있었기 때문에 해당되지 않았다.

 

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.41 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
asset runtime.js 87.5 KiB [emitted] [compared for emit] (name: runtime)
asset bundle.js 83.7 KiB [compared for emit] (name: bundle)
Entrypoint bundle 7.58 MiB = runtime.js 87.5 KiB vendor.js 7.41 MiB bundle.js 83.7 KiB
runtime modules 25 KiB 12 modules
orphan modules 241 bytes [orphan] 4 modules
modules by path ./node_modules/ 2.78 MiB 359 modules
modules by path ./src/ 26.2 KiB
  modules by path ./src/components/*.vue 12.6 KiB
    ./src/components/Home.vue 873 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 968 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/Home.vue?vue&type=template&id=8dc7cce2&ts=true 2.63 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.13 KiB [built] [code generated]
    + 6 modules
  ./src/app.ts 4.17 KiB [built] [code generated]
  ./src/app.css 9.4 KiB [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.88.2 compiled successfully in 2784 ms
Webpack compilation complete. Watching for file changes.
Type-checking in progress...
File change detected. Starting incremental webpack compilation...
assets by status 7.58 MiB [cached] 3 assets
Entrypoint bundle 7.58 MiB = runtime.js 87.5 KiB vendor.js 7.41 MiB bundle.js 83.7 KiB
cached modules 2.79 MiB (javascript) 25 KiB (runtime) [cached] 389 modules
./src/app.css 9.4 KiB [built]
webpack 5.88.2 compiled successfully in 160 ms
Webpack compilation complete. Watching for file changes.
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Building project...
Gradle build...
No errors found.
         + applying user-defined configuration from D:\workspace\NativeScriptVue3Project\App_Resources\Android\before-plugins.gradle
         + setting applicationId
         + applying user-defined configuration from D:\workspace\NativeScriptVue3Project\App_Resources\Android\app.gradle
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: D:\workspace\NativeScriptVue3Project\node_modules\@nativescript\core\platforms\android\core.aar
         + adding aar plugin dependency: D:\workspace\NativeScriptVue3Project\node_modules\@nativescript\core\platforms\android\widgets-release.aar
Project successfully built.
Build time: 12.163 s.
The build result is located at: D:\workspace\NativeScriptVue3Project\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Installing on device LGH8702a5eb2f4...
Successfully installed on device with identifier 'LG2a5eb2f4'.
Unable to apply changes on device: LG2a5eb2f4. Error is: Invalid Version: null.

 

결국 다른것이 원인이라는 소린인데, 역시 잘 되지 않을때는... 컴퓨터 재부팅, 스마트폰 재부팅, 앱 완전 삭제, 클린 빌드 루틴으로 재시도 하기 시작했다.

 

결국에는 ns clean 명령어로 클린 후 재빌드 설치하니 모든것이 다시 잘되는 현상.. 기능을 크게 건드린 것도 없는데 왜 그랬을까...? 아무튼 알 수 없는 노릇이다.

반응형