nativescript-community / licenses

Apache License 2.0
0 stars 1 forks source link

licenses.json doesn't exist #2

Closed coolboy0961 closed 3 years ago

coolboy0961 commented 3 years ago

Does this plugin support NS8?

this is my useage in app.ts. image

I got the error below.

ERROR in ./app/app.ts 80:17-41
Module not found: Error: Can't resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
  Parsed request is a module
  using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./app)
    resolve as module
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/node_modules doesn't exist or is not a directory
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/node_modules doesn't exist or is not a directory
      /Users/chenj49/git/node_modules doesn't exist or is not a directory
      /Users/chenj49/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

webpack 5.47.1 compiled with 1 error in 386 ms
Webpack compilation complete. Watching for file changes.
Issues checking in progress...
No issues found.
Installing pods...
[!] Your Podfile requires that the plugin `cocoapods-acknowledgements` be installed. Please install it and try installation again.
'pod install' command failed.

this is my package.json

  "dependencies": {
    "@nativescript-community/licenses": "^1.1.10",
    "@nativescript-community/ui-lottie": "^4.1.2",
    "@nativescript/core": "~8.0.6",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/iqkeyboardmanager": "^2.0.0",
    "@nativescript/secure-storage": "^3.0.0",
    "@nativescript/theme": "~3.0.1",
    "@nstudio/nativescript-checkbox": "^2.0.4",
    "axios": "^0.21.1",
    "lodash": "^4.17.21",
    "nativescript-clipboard": "^2.1.1",
    "nativescript-dna-deviceinfo": "^3.7.1",
    "nativescript-vue": "~2.9.0",
    "nativescript-vue-router-ns": "^1.0.4",
    "vue-class-component": "^7.2.6",
    "vue-property-decorator": "^9.1.2",
    "vuelidate-property-decorators": "^1.0.28",
    "vuex": "^3.6.2",
    "vuex-class": "^0.3.2",
    "vuex-module-decorators": "^1.0.1"
  },
  "devDependencies": {
    "@babel/preset-env": "^7.14.2",
    "@nativescript/android": "8.0.0",
    "@nativescript/eslint-plugin": "0.0.4",
    "@nativescript/ios": "8.0.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "beta",
    "@types/jasmine": "^3.7.4",
    "@types/jest": "^26.0.23",
    "@types/lodash": "^4.14.170",
    "@types/node": "~14.6.2",
    "@types/vuelidate": "^0.7.14",
    "@typescript-eslint/eslint-plugin": "^4.27.0",
    "@typescript-eslint/parser": "^4.27.0",
    "@vue/eslint-config-typescript": "^7.0.0",
    "@vue/test-utils": "^1.2.0",
    "axios-mock-adapter": "^1.19.0",
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "^26.6.3",
    "cli-table": "https://github.com/telerik/cli-table/tarball/v0.3.1.2",
    "cpx": "^1.5.0",
    "eslint": "^7.28.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^3.4.0",
    "eslint-plugin-vue": "^7.11.1",
    "flush-promises": "^1.0.2",
    "jest": "^26.6.3",
    "jest-html-reporter": "^3.4.0",
    "jest-sonar-reporter": "^2.0.0",
    "marked-terminal": "https://github.com/NativeScript/marked-terminal/tarball/v3.1.1n",
    "nativescript": "^8.0.2",
    "nativescript-vue-jest": "^3.0.4",
    "nativescript-vue-template-compiler": "~2.9.0",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.3.0",
    "sonar-scanner": "^3.1.0",
    "tns-platform-declarations": "^6.5.15",
    "ts-jest": "^26.5.6",
    "typescript": "~4.0.0",
    "vue": "^2.6.12",
    "vue-eslint-parser": "^7.6.0",
    "vue-jest": "^3.0.7",
    "vue-template-compiler": "^2.6.12"
  },
  "private": "true",
  "readme": "NativeScript Application"
farfromrefug commented 3 years ago

@coolboy0961 yes it does. On iOS you need to first run gem install cocoapods-acknowledgements. Sadly i cant automate this. I ll update the readme

coolboy0961 commented 3 years ago

@farfromrefug Thank you very much for your quick feedback.

I will try it.

And I still got same error when I build android version.

this is the error log.

ERROR in ./app/app.ts 80:17-41
Module not found: Error: Can't resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
  Parsed request is a module
  using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./app)
    resolve as module
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .android.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .android.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .android.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .android.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .android.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .android.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/node_modules doesn't exist or is not a directory
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .android.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .android.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .android.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .android.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .android.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .android.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.android.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/node_modules doesn't exist or is not a directory
      /Users/chenj49/git/node_modules doesn't exist or is not a directory
      /Users/chenj49/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

webpack 5.47.1 compiled with 1 error in 311 ms
Webpack compilation complete. Watching for file changes.
Issues checking in progress...
No issues found.
Built aar for @nativescript/firebase
@nativescript-community/licenses: 

@nativescript-community/licenses: > Configure project :app

@nativescript-community/licenses:        + setting applicationId

@nativescript-community/licenses: Script '/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/firebase/platforms/android/include.gradle' line: 96
A problem occurred evaluating script.

@nativescript-community/licenses: Plugin with id 'com.google.gms.google-services' not found.

@nativescript-community/licenses: 

child process exited with code 1
Error: generateLicenseReport failed
    at ChildProcess.<anonymous> (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript-community/licenses/scripts/after-prepareNativeApp.js:46:28)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:376:20)
    at Pipe.<anonymous> (net.js:673:12)
generateLicenseReport failed

I noticed this part of error log. Should I also install something before build android version?

@nativescript-community/licenses: Plugin with id 'com.google.gms.google-services' not found.

@nativescript-community/licenses: 
child process exited with code 1
Error: generateLicenseReport failed
    at ChildProcess.<anonymous> (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript-community/licenses/scripts/after-prepareNativeApp.js:46:28)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:376:20)
    at Pipe.<anonymous> (net.js:673:12)
generateLicenseReport failed
farfromrefug commented 3 years ago

@coolboy0961 ok so iOS works? Android. Could you try to modify node_modules/@nativescript-community/licences/platforms/android/dependecy-report.gradle and change classpath 'com.github.jk1:gradle-license-report:1.16' to classpath 'com.github.jk1:gradle-license-report:1.17' ?

coolboy0961 commented 3 years ago

@farfromrefug

unfortunately ios still does not work. I installed cocoapods-acknowledgements by flowing command.

$ sudo gem install cocoapods-acknowledgements
Password:
Building native extensions. This could take a while...
Successfully installed redcarpet-3.5.1
Successfully installed cocoapods-acknowledgements-1.3.0
Parsing documentation for redcarpet-3.5.1
Installing ri documentation for redcarpet-3.5.1
Parsing documentation for cocoapods-acknowledgements-1.3.0
Installing ri documentation for cocoapods-acknowledgements-1.3.0
Done installing documentation for redcarpet, cocoapods-acknowledgements after 0 seconds
2 gems installed

this is all of my log after I execute npm command.

> @nativescript/template-blank-vue-ts@8.0.3 serve:clean:ios /Users/chenj49/git/git_gs-linemo-native-app/native-app
> ns run ios --clean --device 'iPhone 12' --sdk '14.4' --bundle --env.replace=./environments/environment.ts:./environments/environment.local.ios.ts

Searching for devices...
Your application will be deployed only on the device specified by the provided index or identifier.
Preparing project...
webpack is watching the files...
DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(blue($color) * 114, 1000)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
75 │     $color-brightness: round((red($color) * 299) + (green($color) * 587) + (blue($color) * 114) / 1000);
   │                                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 75:76  check-contrast()
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 84:49  alternate()
    node_modules/@nativescript/theme/scss/variables/_index.scss 66:23   @import
    node_modules/@nativescript/theme/scss/core/_index.scss 2:9          @import
    node_modules/@nativescript/theme/core.scss 8:9                      @import
    app/app.scss 3:9                                                    root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div(blue(#ffffff) * 114, 1000)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
76 │     $light-color: round((red(#ffffff) * 299) + (green(#ffffff) * 587) + (blue(#ffffff) * 114) / 1000);
   │                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   ╵
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 76:73  check-contrast()
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 84:49  alternate()
    node_modules/@nativescript/theme/scss/variables/_index.scss 66:23   @import
    node_modules/@nativescript/theme/scss/core/_index.scss 2:9          @import
    node_modules/@nativescript/theme/core.scss 8:9                      @import
    app/app.scss 3:9                                                    root stylesheet

DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($light-color, 1.7)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
78 │     @return abs($color-brightness) < ($light-color / 1.7);
   │                                       ^^^^^^^^^^^^^^^^^^
   ╵
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 78:39  check-contrast()
    node_modules/@nativescript/theme/scss/mixins/_utilities.scss 84:49  alternate()
    node_modules/@nativescript/theme/scss/variables/_index.scss 66:23   @import
    node_modules/@nativescript/theme/scss/core/_index.scss 2:9          @import
    node_modules/@nativescript/theme/core.scss 8:9                      @import
    app/app.scss 3:9                                                    root stylesheet

assets by path images/*.png 123 KiB 13 assets
assets by path fonts/ 10.4 MiB
  assets by path fonts/*.ttf 385 KiB 4 assets
  assets by path fonts/*.otf 10.1 MiB
    asset fonts/NotoSansJP-Bold.otf 4.47 MiB [compared for emit] [from: app/fonts/NotoSansJP-Bold.otf] [copied]
    asset fonts/NotoSansJP-Regular.otf 4.34 MiB [compared for emit] [from: app/fonts/NotoSansJP-Regular.otf] [copied]
    asset fonts/fa5-regular-400.otf 1.24 MiB [compared for emit] [from: app/fonts/fa5-regular-400.otf] [copied]
assets by path *.js 11.7 MiB
  asset vendor.js 10.4 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 1.19 MiB [compared for emit] (name: bundle)
  asset runtime.js 87.3 KiB [compared for emit] (name: runtime)
asset tns_modules/inspector_modules.js 1.25 KiB [compared for emit] (name: tns_modules/inspector_modules)
Entrypoint bundle 11.7 MiB = runtime.js 87.3 KiB vendor.js 10.4 MiB bundle.js 1.19 MiB
Entrypoint tns_modules/inspector_modules 10.5 MiB = runtime.js 87.3 KiB vendor.js 10.4 MiB tns_modules/inspector_modules.js 1.25 KiB
runtime modules 24.8 KiB 13 modules
orphan modules 538 bytes [orphan] 7 modules
modules by path ./node_modules/ 3.87 MiB 385 modules
modules by path ./app/ 386 KiB
  modules by path ./app/pages/*.vue 155 KiB 73 modules
  modules by path ./app/components/*.vue 19.4 KiB 21 modules
  modules by path ./app/styles/*.scss 40.2 KiB 14 modules
  modules by path ./app/utils/*.ts 24.2 KiB 6 modules
  modules by path ./app/store/*.ts 5.96 KiB 3 modules
  modules by path ./app/exception/*.ts 9.23 KiB 3 modules
  ./app/app.ts 5.83 KiB [built] [code generated]
  ./app/app.scss 125 KiB [built] [code generated]
  ./app/router/index.ts 1.51 KiB [built] [code generated]
./environments/environment.local.ios.ts 410 bytes [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]

ERROR in ./app/app.ts 80:17-41
Module not found: Error: Can't resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
  Parsed request is a module
  using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./app)
    resolve as module
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/node_modules doesn't exist or is not a directory
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/node_modules doesn't exist or is not a directory
      /Users/chenj49/git/node_modules doesn't exist or is not a directory
      /Users/chenj49/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

webpack 5.47.1 compiled with 1 error in 7175 ms
Webpack compilation complete. Watching for file changes.
nativescript-plugin-firebase: /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/ios/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
Issues checking in progress...
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/Users/chenj49/git/git_gs-linemo-native-app/native-app/environments/environment.ts'
File change detected. Starting incremental webpack compilation...
assets by status 22.2 MiB [cached] 24 assets
Entrypoint bundle 11.7 MiB = runtime.js 87.3 KiB vendor.js 10.4 MiB bundle.js 1.19 MiB
Entrypoint tns_modules/inspector_modules 10.5 MiB = runtime.js 87.3 KiB vendor.js 10.4 MiB tns_modules/inspector_modules.js 1.25 KiB
cached modules 4.25 MiB (javascript) 24.8 KiB (runtime) [cached] 577 modules

ERROR in ./app/app.ts 80:17-41
Module not found: Error: Can't resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
resolve 'licenses.json' in '/Users/chenj49/git/git_gs-linemo-native-app/native-app/app'
  Parsed request is a module
  using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./app)
    resolve as module
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/node_modules doesn't exist or is not a directory
      looking for modules in /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules
        single file module
          using description file: /Users/chenj49/git/git_gs-linemo-native-app/native-app/package.json (relative path: ./node_modules/licenses.json)
            no extension
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
            .ios.vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.vue doesn't exist
            .vue
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.vue doesn't exist
            .ios.ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.ts doesn't exist
            .ts
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ts doesn't exist
            .ios.js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.js doesn't exist
            .js
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.js doesn't exist
            .ios.css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.css doesn't exist
            .css
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.css doesn't exist
            .ios.scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.scss doesn't exist
            .scss
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.scss doesn't exist
            .ios.json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.ios.json doesn't exist
            .json
              /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json.json doesn't exist
        /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/licenses.json doesn't exist
      /Users/chenj49/git/git_gs-linemo-native-app/node_modules doesn't exist or is not a directory
      /Users/chenj49/git/node_modules doesn't exist or is not a directory
      /Users/chenj49/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory

webpack 5.47.1 compiled with 1 error in 310 ms
Webpack compilation complete. Watching for file changes.
Issues checking in progress...
No issues found.
Installing pods...
Analyzing dependencies
Pre-downloading: `lottie-ios` from `https://github.com/farfromrefug/lottie-ios.git`
Downloading dependencies
Installing BEMCheckBox (1.4.1)
Installing Firebase (6.34.0)
Installing FirebaseABTesting (4.2.0)
Installing FirebaseAnalytics (6.9.0)
Installing FirebaseCore (6.10.4)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseCrashlytics (4.6.2)
Installing FirebaseDynamicLinks (4.3.1)
Installing FirebaseInstallations (1.7.0)
Installing FirebasePerformance (3.3.2)
Installing FirebaseRemoteConfig (4.9.1)
Installing GTMSessionFetcher (1.5.0)
Installing GoogleAppMeasurement (6.9.0)
Installing GoogleDataTransport (7.5.1)
Installing GoogleToolboxForMac (2.3.1)
Installing GoogleUtilities (6.7.2)
Installing IQKeyboardManager (6.2.1)
Installing PromisesObjC (1.2.12)
Installing Protobuf (3.17.0)
Installing SAMKeychain (1.5.3)
Installing lottie-ios (3.2.3)
Installing nanopb (1.30906.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `nativeapp.xcworkspace` for this project from now on.
Adding Acknowledgements
Pod installation complete! There are 9 dependencies from the Podfile and 22 total pods installed.
Updating runtime package.json with configuration values...
Project successfully prepared (ios)
Configure firebase
Add iOS crash logging
Building project...
Xcode build...
warning: Stale file '/Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/ios/build/sharedpch/SharedPrecompiledHeaders/7876592723579193641/nativeapp-Prefix.pch.gch' is located outside of the allowed root paths.

note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override: 
note: Planning build
note: Constructing build description
Project successfully built.
The build result is located at: /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/ios/build/Debug-iphonesimulator/nativeapp.app
Installing on device 815A14A1-911D-482B-9582-9D73ACEB17A5...
Successfully installed on device with identifier '815A14A1-911D-482B-9582-9D73ACEB17A5'.
Successfully transferred all files on device 815A14A1-911D-482B-9582-9D73ACEB17A5.
Restarting application on device 815A14A1-911D-482B-9582-9D73ACEB17A5...
CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
CONSOLE LOG: restore : null
CONSOLE LOG: mutation: native-app-store/setAllState
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: Cannot find module 'licenses.json'
at
webpackMissingModule(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at ./app/app.ts(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at __webpack_require__(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/bootstrap:24:0)
at __webpack_exec__(file:///app/bundle.js:7183:39)
at (file:///app/bundle.js:7184:143)
at __webpack_require__.X(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/runtime/startup entrypoint:6:0)
at (file:///app/bundle.js:7184:47)
at (file:///app/bundle.js:7189:3)
at require(:1:137)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: Cannot find module 'licenses.json'
at
webpackMissingModule(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at ./app/app.ts(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at __webpack_require__(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/bootstrap:24:0)
at __webpack_exec__(file:///app/bundle.js:7183:39)
at (file:///app/bundle.js:7184:143)
at __webpack_require__.X(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/runtime/startup entrypoint:6:0)
at (file:///app/bundle.js:7184:47)
at (file:///app/bundle.js:7189:3)
at require(:1:137)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
2   NativeScript                        0x00000001048ba914 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 914
3   NativeScript                        0x0000000104d1af65 _ZN2v88internal14MessageHandler25Repor<…>
CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
NativeScript debugger has opened inspector socket on port 18183 for test.softbank.esimapp.
Successfully synced application test.softbank.esimapp on device 815A14A1-911D-482B-9582-9D73ACEB17A5.
CONSOLE LOG: restore : null
CONSOLE LOG: mutation: native-app-store/setAllState
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error: Uncaught Error: Cannot find module 'licenses.json'
at
webpackMissingModule(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at ./app/app.ts(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at __webpack_require__(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/bootstrap:24:0)
at __webpack_exec__(file:///app/bundle.js:7183:39)
at (file:///app/bundle.js:7184:143)
at __webpack_require__.X(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/runtime/startup entrypoint:6:0)
at (file:///app/bundle.js:7184:47)
at (file:///app/bundle.js:7189:3)
at require(:1:137)
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught Error: Cannot find module 'licenses.json'
at
webpackMissingModule(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at ./app/app.ts(file: app/webpack:/@nativescript/template-blank-vue-ts/app/app.ts:110:8)
at __webpack_require__(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/bootstrap:24:0)
at __webpack_exec__(file:///app/bundle.js:7183:39)
at (file:///app/bundle.js:7184:143)
at __webpack_require__.X(file: app/webpack:/@nativescript/template-blank-vue-ts/webpack/runtime/startup entrypoint:6:0)
at (file:///app/bundle.js:7184:47)
at (file:///app/bundle.js:7189:3)
at require(:1:137)
', reason: '(null)'
*** First throw call stack:
(
0   CoreFoundation                      0x00007fff20421af6 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff20177e78 objc_exception_throw + 48
2   NativeScript                        0x000000010d2d4914 _ZN3tns21NativeScriptException15OnUncaughtErrorEN2v85LocalINS1_7MessageEEENS2_INS1_5ValueEEE + 914
3   NativeScript                        0x000000010d734f65 _ZN2v88internal14MessageHandler25Repor<…>
farfromrefug commented 3 years ago

@coolboy0961 i am dumb i know what s going on! you need to tell webpack that licenses.json is an external. Somewhere in your webpack config add this config.externals.push('~/licenses.json'); And require ~/licenses.json instead of licenses.json

coolboy0961 commented 3 years ago

@farfromrefug

I am not good at the config of webpack. I add your suggestion below.

webpack.config.js

const webpack = require("@nativescript/webpack");

module.exports = (env) => {
  webpack.init(env);

  // Learn how to customize:
  // https://docs.nativescript.org/webpack

  config.externals.push("~/licenses.json");

  return webpack.resolveConfig();
};

And I got following error.


> @nativescript/template-blank-vue-ts@8.0.3 serve:clean:ios /Users/chenj49/git/git_gs-linemo-native-app/native-app
> ns run ios --clean --device 'iPhone 12' --sdk '14.4' --bundle --env.replace=./environments/environment.ts:./environments/environment.local.ios.ts

Searching for devices...
Your application will be deployed only on the device specified by the provided index or identifier.
Preparing project...
ReferenceError: config is not defined
    at module.exports (/Users/chenj49/git/git_gs-linemo-native-app/native-app/webpack.config.js:9:3)
    at Command.<anonymous> (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/webpack/dist/bin/index.js:60:44)
    at Command.listener [as _actionHandler] (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/commander/index.js:922:31)
    at Command._parseCommand (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/commander/index.js:1503:14)
    at Command._dispatchSubcommand (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/commander/index.js:1443:18)
    at Command._parseCommand (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/commander/index.js:1460:12)
    at Command.parse (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/commander/index.js:1292:10)
    at Object.<anonymous> (/Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/webpack/dist/bin/index.js:97:21)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47
No configuration!
Executing webpack failed with exit code 0.
coolboy0961 commented 3 years ago

@farfromrefug

I changed my webpack like this below and it works. Also the ios licenses infomation is outputed. Thank you very much.

const webpack = require("@nativescript/webpack");

module.exports = (env) => {
  webpack.init(env);

  // Learn how to customize:
  // https://docs.nativescript.org/webpack
  webpack.chainWebpack((config) => {
    config.externals(
      // make sure to keep pre-defined externals
      config.get("externals").concat([
        // add your own externals
        "~/licenses.json",
      ])
    );
  });

  return webpack.resolveConfig();
};
coolboy0961 commented 3 years ago

@farfromrefug

According to this change android version also works. image

Could you release an update version? Thank you.

farfromrefug commented 3 years ago

@coolboy0961 just released 1.1.11

coolboy0961 commented 3 years ago

@farfromrefug

I checked the new version if android build works. I am sorry, I found the same error about @nativescript-community/licenses: Plugin with id 'com.google.gms.google-services' not found.

And I found the really solution. If I run ios build first successfully then you can run android build fine. If I delete the hooks, platform , node_module, folder, run npm ci then run android build first, the error occurs.

I think maybe this relate to @nativescript/firebase. when ios build processed, I found the following dependencies are installed. @nativescript/firebase is only thing I can imagine which relate to com.google.gms.google-services.

Downloading dependencies
Installing BEMCheckBox (1.4.1)
Installing Firebase (6.34.0)
Installing FirebaseABTesting (4.2.0)
Installing FirebaseAnalytics (6.9.0)
Installing FirebaseCore (6.10.4)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseCrashlytics (4.6.2)
Installing FirebaseDynamicLinks (4.3.1)
Installing FirebaseInstallations (1.7.0)
Installing FirebasePerformance (3.3.2)
Installing FirebaseRemoteConfig (4.9.1)
Installing GTMSessionFetcher (1.5.0)
Installing GoogleAppMeasurement (6.9.0)
Installing GoogleDataTransport (7.5.1)
Installing GoogleToolboxForMac (2.3.1)
Installing GoogleUtilities (6.7.2)
Installing IQKeyboardManager (6.2.1)
Installing PromisesObjC (1.2.12)
Installing Protobuf (3.17.0)
Installing SAMKeychain (1.5.3)
Installing lottie-ios (3.2.3)
Installing nanopb (1.30906.0)
Downloading dependencies
Installing BEMCheckBox (1.4.1)
Installing Firebase (6.34.0)
Installing FirebaseABTesting (4.2.0)
Installing FirebaseAnalytics (6.9.0)
Installing FirebaseCore (6.10.4)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseCrashlytics (4.6.2)
Installing FirebaseDynamicLinks (4.3.1)
Installing FirebaseInstallations (1.7.0)
Installing FirebasePerformance (3.3.2)
Installing FirebaseRemoteConfig (4.9.1)
Installing GTMSessionFetcher (1.5.0)
Installing GoogleAppMeasurement (6.9.0)
Installing GoogleDataTransport (7.5.1)
Installing GoogleToolboxForMac (2.3.1)
Installing GoogleUtilities (6.7.2)
Installing IQKeyboardManager (6.2.1)
Installing PromisesObjC (1.2.12)
Installing Protobuf (3.17.0)
Installing SAMKeychain (1.5.3)
Installing lottie-ios (3.2.3)
Installing nanopb (1.30906.0)  
farfromrefug commented 3 years ago

@coolboy0961 i never use firebase which might be why i never had that issue. But what is weird is the android version does not have nothing in common with ios. I think it is related to how the firebase plugin modifies android gradle files. It is a mess and it might be breaking the licenses gradle config. Honestly i cant really do much about it. I really dont want to get into @nativescript/firebase :s

coolboy0961 commented 3 years ago

@farfromrefug

OK, I understand. Thanks.