nativescript-community / licenses

Apache License 2.0
0 stars 1 forks source link

Building android package failed when using @nativescript/firebase #3

Open coolboy0961 opened 3 years ago

coolboy0961 commented 3 years ago

@farfromrefug Sorry, me again. I really want to use your plugin to generate both ios and android licenses. Please forgive me to add issue again.

I got an error @nativescript-community/licenses: Plugin with id 'com.google.gms.google-services' not found. when I build android package. com.google.gms.google-services is a plugin which is used in @nativescript/firebase. You can find it in node_modules/@nativescript/firebase/platforms/android/include.gradle.

Sometimes build android package will success, I do not know how it happens. But in that time, I noticed this log @nativescript-community/licenses: + couldn't load user-defined configuration from /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/App_Resources/Android/app.gradle. File doesn't exist.. My real app.gradle file path is /Users/chenj49/git/git_gs-linemo-native-app/native-app/App_Resources/Android/app.gradle. So I think something wrong in @nativescript-community/licenses because it looked a wrong path, and that lead to make android build succeed.

I do not know what's wrong with it, I can not ask you to fix something exactly, but I really hope that we can make this plugin working on @nativescript/firebase.

I will share the logs in following situations.

The following log is output when build ios package successfully.

$ npm run package:ios

> @nativescript/template-blank-vue-ts@8.0.3 package:ios /Users/chenj49/git/git_gs-linemo-native-app/native-app
> ns build ios --env.replace=./environments/environment.ts:./environments/environment.e2e.ios.ts

Copying template files...
Platform ios successfully added. v8.0.0
Preparing project...
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 [emitted] [from: app/fonts/NotoSansJP-Bold.otf] [copied]
    asset fonts/NotoSansJP-Regular.otf 4.34 MiB [emitted] [from: app/fonts/NotoSansJP-Regular.otf] [copied]
    asset fonts/fa5-regular-400.otf 1.24 MiB [emitted] [from: app/fonts/fa5-regular-400.otf] [copied]
assets by path *.js 11.5 MiB
  asset vendor.js 10.4 MiB [emitted] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 1.14 MiB [emitted] (name: bundle)
  asset runtime.js 13.7 KiB [emitted] (name: runtime)
asset tns_modules/inspector_modules.js 1.25 KiB [emitted] (name: tns_modules/inspector_modules)
Entrypoint bundle 11.5 MiB = runtime.js 13.7 KiB vendor.js 10.4 MiB bundle.js 1.14 MiB
Entrypoint tns_modules/inspector_modules 10.4 MiB = runtime.js 13.7 KiB vendor.js 10.4 MiB tns_modules/inspector_modules.js 1.25 KiB
runtime modules 2.84 KiB 9 modules
orphan modules 538 bytes [orphan] 7 modules
modules by path ./node_modules/ 3.86 MiB 385 modules
modules by path ./app/ 374 KiB
  modules by path ./app/pages/*.vue 147 KiB 73 modules
  modules by path ./app/components/*.vue 17.1 KiB 21 modules
  modules by path ./app/styles/*.scss 38.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
  3 modules
modules by path external "~/*.json" 84 bytes
  external "~/licenses.json" 42 bytes [built] [code generated]
  external "~/package.json" 42 bytes [optional] [built] [code generated]
./environments/environment.e2e.ios.ts 455 bytes [built] [code generated]
webpack 5.49.0 compiled successfully in 9697 ms
Webpack compilation complete.
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!
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...
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

The following log is output when build android package successfully.

$ npm run package:android

> @nativescript/template-blank-vue-ts@8.0.3 package:android /Users/chenj49/git/git_gs-linemo-native-app/native-app
> ns build android --env.replace=./environments/environment.ts:./environments/environment.e2e.android.ts

Preparing project...
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
    asset fonts/fa-solid-900.ttf 204 KiB [compared for emit] [from: app/fonts/fa-solid-900.ttf] [copied]
    asset fonts/fa-brands-400.ttf 131 KiB [compared for emit] [from: app/fonts/fa-brands-400.ttf] [copied]
    asset fonts/fa-regular-400.ttf 39.1 KiB [compared for emit] [from: app/fonts/fa-regular-400.ttf] [copied]
    asset fonts/wing-icon.ttf 10.9 KiB [compared for emit] [from: app/fonts/wing-icon.ttf] [copied]
  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.2 MiB
  asset vendor.js 10.1 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 1.14 MiB [compared for emit] (name: bundle)
  asset runtime.js 13.7 KiB [compared for emit] (name: runtime)
Entrypoint bundle 11.2 MiB = runtime.js 13.7 KiB vendor.js 10.1 MiB bundle.js 1.14 MiB
runtime modules 2.84 KiB 9 modules
orphan modules 542 bytes [orphan] 7 modules
modules by path ./node_modules/ 3.74 MiB 381 modules
modules by path ./app/ 374 KiB
  modules by path ./app/pages/*.vue 147 KiB 73 modules
  modules by path ./app/components/*.vue 17.1 KiB 21 modules
  modules by path ./app/styles/*.scss 38.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
  3 modules
modules by path external "~/*.json" 84 bytes
  external "~/licenses.json" 42 bytes [built] [code generated]
  external "~/package.json" 42 bytes [optional] [built] [code generated]
./environments/environment.e2e.android.ts 463 bytes [built] [code generated]
webpack 5.49.0 compiled successfully in 8903 ms
Webpack compilation complete.
nativescript-plugin-firebase: /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/android/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
@nativescript-community/licenses: 

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

@nativescript-community/licenses:        + setting applicationId

@nativescript-community/licenses:        + couldn't load user-defined configuration from /Users/chenj49/git/git_gs-linemo-native-app/native-app/app/App_Resources/Android/app.gradle. File doesn't exist.

@nativescript-community/licenses:        + using android X library androidx.legacy:legacy-support-v4:1.0.0

@nativescript-community/licenses:        + adding nativescript runtime package dependency: nativescript-optimized-with-inspector

@nativescript-community/licenses:        + adding aar plugin dependency: /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/core/platforms/android/widgets-release.aar
         + adding aar plugin dependency: /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/firebase/platforms/android/firebase.aar

@nativescript-community/licenses: 
> Task :app:generateLicenseReport

@nativescript-community/licenses: 1 actionable task: 1 executed

child process exited with code 0
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Configure firebase
Copy /Users/chenj49/git/git_gs-linemo-native-app/native-app/App_Resources/Android/google-services.json to /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/android/app/google-services.json.
Building project...
Gradle build...
         + setting applicationId
         + applying user-defined configuration from /Users/chenj49/git/git_gs-linemo-native-app/native-app/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/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/core/platforms/android/widgets-release.aar
         + adding aar plugin dependency: /Users/chenj49/git/git_gs-linemo-native-app/native-app/node_modules/@nativescript/firebase/platforms/android/firebase.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Project successfully built.
The build result is located at: /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/android/app/build/outputs/apk/debug/app-debug.apk

The following log is output when build android package fail.

$ npm run package:android

> @nativescript/template-blank-vue-ts@8.0.3 package:android /Users/chenj49/git/git_gs-linemo-native-app/native-app
> ns build android --env.replace=./environments/environment.ts:./environments/environment.e2e.android.ts

Copying template files...
Platform android successfully added. v8.0.0
Preparing project...
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
    asset fonts/fa-solid-900.ttf 204 KiB [emitted] [from: app/fonts/fa-solid-900.ttf] [copied]
    asset fonts/fa-brands-400.ttf 131 KiB [emitted] [from: app/fonts/fa-brands-400.ttf] [copied]
    asset fonts/fa-regular-400.ttf 39.1 KiB [emitted] [from: app/fonts/fa-regular-400.ttf] [copied]
    asset fonts/wing-icon.ttf 10.9 KiB [emitted] [from: app/fonts/wing-icon.ttf] [copied]
  assets by path fonts/*.otf 10.1 MiB
    asset fonts/NotoSansJP-Bold.otf 4.47 MiB [emitted] [from: app/fonts/NotoSansJP-Bold.otf] [copied]
    asset fonts/NotoSansJP-Regular.otf 4.34 MiB [emitted] [from: app/fonts/NotoSansJP-Regular.otf] [copied]
    asset fonts/fa5-regular-400.otf 1.24 MiB [emitted] [from: app/fonts/fa5-regular-400.otf] [copied]
assets by path *.js 11.2 MiB
  asset vendor.js 10 MiB [emitted] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 1.14 MiB [emitted] (name: bundle)
  asset runtime.js 13.7 KiB [emitted] (name: runtime)
Entrypoint bundle 11.2 MiB = runtime.js 13.7 KiB vendor.js 10 MiB bundle.js 1.14 MiB
runtime modules 2.84 KiB 9 modules
orphan modules 542 bytes [orphan] 7 modules
modules by path ./node_modules/ 3.73 MiB 381 modules
modules by path ./app/ 374 KiB
  modules by path ./app/pages/*.vue 147 KiB 73 modules
  modules by path ./app/components/*.vue 17.1 KiB 21 modules
  modules by path ./app/styles/*.scss 38.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
  3 modules
modules by path external "~/*.json" 84 bytes
  external "~/licenses.json" 42 bytes [built] [code generated]
  external "~/package.json" 42 bytes [optional] [built] [code generated]
./environments/environment.e2e.android.ts 463 bytes [built] [code generated]
webpack 5.49.0 compiled successfully in 9825 ms
Webpack compilation complete.
nativescript-plugin-firebase: /Users/chenj49/git/git_gs-linemo-native-app/native-app/platforms/android/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
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
@nativescript-community/licenses: 
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
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @nativescript/template-blank-vue-ts@8.0.3 package:android: `ns build android --env.replace=./environments/environment.ts:./environments/environment.e2e.android.ts`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @nativescript/template-blank-vue-ts@8.0.3 package:android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/chenj49/.npm/_logs/2021-08-07T07_55_35_353Z-debug.log
coolboy0961 commented 3 years ago

I found the fail and succeed pattern.

1. rm -rf ./hooks ./platforms ./node_modules npm ci build android → fail

2. rm -rf ./hooks ./platforms ./node_modules npm ci build ios → succeed build android → fail

3. rm -rf ./hooks ./platforms ./node_modules npm ci build android → fail build ios → succeed build android → succeed

I also noticed that if app.grade is not found, @nativescript-community/licenses will using android X library androidx.legacy:legacy-support-v4:1.0.0. Maybe @nativescript-community/licenses execute something when app.grade is not found and it let android build succeed.

farfromrefug commented 3 years ago

@coolboy0961 I think the best would be for to try with a sample app without @nativescript/firebase. If you can reproduce it there it would be easier for me to fix it. There might be indeed an issue with the path

coolboy0961 commented 3 years ago

@coolboy0961 OK, I will create a sample app to reproduce the problem.

coolboy0961 commented 3 years ago

@farfromrefug

I created the sample app to reproduce the problem, could you clone it? https://github.com/coolboy0961/sample-app-for-reproduce.git

The steps to confirm build android successfully without install @nativescript/firebase

@nativescript-community/licenses@1.1.11 postinstall /Users/chenj49/git/sample-app-reproduce-license/node_modules/@nativescript-community/licenses node postinstall.js

@nativescript/core@8.0.8 postinstall /Users/chenj49/git/sample-app-reproduce-license/node_modules/@nativescript/core node cli-hooks/postinstall.js

npm notice created a lockfile as package-lock.json. You should commit this file. added 399 packages from 295 contributors and audited 400 packages in 19.759s

40 packages are looking for funding run npm fund for details

found 2 vulnerabilities (1 low, 1 moderate) run npm audit fix to fix them, or npm audit for details Copying template files... Platform android successfully added. v8.0.0 Preparing project...

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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31: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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31: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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31:9 root stylesheet

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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1: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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1: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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1:9 root stylesheet

assets by path .js 6.87 MiB asset vendor.js 6.51 MiB [emitted] (name: vendor) (id hint: defaultVendor) asset bundle.js 350 KiB [emitted] (name: bundle) asset runtime.js 12.9 KiB [emitted] (name: runtime) assets by path fonts/.ttf 374 KiB asset fonts/fa-solid-900.ttf 204 KiB [emitted] [from: app/fonts/fa-solid-900.ttf] [copied] asset fonts/fa-brands-400.ttf 131 KiB [emitted] [from: app/fonts/fa-brands-400.ttf] [copied] asset fonts/fa-regular-400.ttf 39.1 KiB [emitted] [from: app/fonts/fa-regular-400.ttf] [copied] Entrypoint bundle 6.87 MiB = runtime.js 12.9 KiB vendor.js 6.51 MiB bundle.js 350 KiB runtime modules 2.72 KiB 8 modules orphan modules 356 bytes [orphan] 6 modules modules by path ./node_modules/@nativescript/core/ 1.4 MiB 162 modules modules by path ./node_modules/css-tree/ 318 KiB 113 modules modules by path ./app/ 127 KiB 9 modules modules by path ./node_modules/source-map/lib/.js 38.2 KiB 6 modules modules by path ./node_modules/reduce-css-calc/dist/ 131 KiB modules by path ./node_modules/reduce-css-calc/dist/lib/.js 11.1 KiB 3 modules modules by path ./node_modules/reduce-css-calc/dist/.js 120 KiB 2 modules modules by path ./node_modules/postcss-value-parser/lib/.js 9.11 KiB 5 modules modules by path ./node_modules/mdn-data/css/.json 242 KiB 3 modules modules by path external "~/.json" 84 bytes external "~/licenses.json" 42 bytes [built] [code generated] external "~/package.json" 42 bytes [optional] [built] [code generated] 4 modules webpack 5.49.0 compiled successfully in 7309 ms Webpack compilation complete. @nativescript-community/licenses:

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

@nativescript-community/licenses: + couldn't load user-defined configuration from /Users/chenj49/git/sample-app-reproduce-license/app/App_Resources/Android/app.gradle. File doesn't exist. @nativescript-community/licenses:

@nativescript-community/licenses: + adding nativescript runtime package dependency: nativescript-optimized-with-inspector

@nativescript-community/licenses: + adding aar plugin dependency: /Users/chenj49/git/sample-app-reproduce-license/node_modules/@nativescript/core/platforms/android/widgets-release.aar @nativescript-community/licenses:

@nativescript-community/licenses:

@nativescript-community/licenses: > Task :app:generateLicenseReport 1 actionable task: 1 executed

child process exited with code 0 Updating runtime package.json with configuration values... Project successfully prepared (android) Building project... Gradle build...

The steps to reproduce the android license build error

@nativescript/firebase@11.1.3 postinstall /Users/chenj49/git/sample-app-reproduce-license/node_modules/@nativescript/firebase node postinstall-hooks.js && node scripts/postinstall.js

NativeScript Firebase Plugin Installation No existing firebase.nativescript.json config file found, so let's configure the Firebase plugin! prompt: Are you using iOS (y/n): (y) prompt: Are you using Android (y/n): (y) prompt: Do you want to enable Firebase Analytics? (y/n): (y) prompt: Are you using Firestore? (y/n): (n) prompt: Are you using Realtime DB? (y/n): (n) prompt: Are you using Firebase Authentication (pretty likely if you use Firestore or Realtime DB)? (y/n): (y) prompt: Are you using Firebase RemoteConfig? (y/n): (n) prompt: Are you using Performance Monitoring? (y/n): (n) prompt: Are you using this plugin as a Push Notification client for an external (NOT Firebase Cloud Messaging) Push service? (y/n): (n) prompt: Are you using Firebase Cloud Messaging? (y/n): (n) prompt: Are you using In-App Messaging? (y/n): (n) prompt: Are you using Firebase Crashlytics? (y/n): (n) prompt: Are you using Firebase Storage? (y/n): (n) prompt: Are you using Firebase Cloud Functions? (y/n): (n) prompt: Are you using Firebase Facebook Authentication? (y/n): (n) prompt: Are you using Firebase Google Authentication? (y/n): (n) prompt: Are you using AdMob? (y/n): (n) prompt: Are you using Firebase Dynamic Links? (y/n): (n) prompt: Are you using ML Kit? (y/n): (n) Successfully created iOS (Pod) file. Install google-service.json after-prepare copy hook. Install google-service.json before-checkForChanges copy hook. Successfully created Android (include.gradle) file. Install google-service.json after-prepare copy hook. Install google-service.json before-checkForChanges copy hook. Firebase post install completed. To re-run this script, navigate to the root directory of nativescript-plugin-firebase in your node_modules folder and run: npm run config. prompt: Do you want to save the selected configuration. Reinstalling the dependency will reuse the setup from: firebase.nativescript.json. CI will be easier. (y/n): (y)

40 packages are looking for funding run npm fund for details

found 4 vulnerabilities (2 low, 2 moderate) run npm audit fix to fix them, or npm audit for details Successfully installed plugin @nativescript/firebase.

- `ns build android`

$ ns build android Preparing project... 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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31: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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31: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 56:11 @import node_modules/@nativescript/theme/scss/variables/_blue.scss 2:9 @import app/components/Home.vue 31:9 root stylesheet

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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1: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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1: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 56:11 @import node_modules/@nativescript/theme/scss/core/_index.scss 2:9 @import node_modules/@nativescript/theme/core.scss 8:9 @import app/app.scss 1:9 root stylesheet

assets by status 6.87 MiB [emitted] asset vendor.js 6.51 MiB [emitted] (name: vendor) (id hint: defaultVendor) asset bundle.js 351 KiB [emitted] (name: bundle) asset runtime.js 12.9 KiB [emitted] (name: runtime) assets by status 374 KiB [compared for emit] asset fonts/fa-solid-900.ttf 204 KiB [compared for emit] [from: app/fonts/fa-solid-900.ttf] [copied] asset fonts/fa-brands-400.ttf 131 KiB [compared for emit] [from: app/fonts/fa-brands-400.ttf] [copied] asset fonts/fa-regular-400.ttf 39.1 KiB [compared for emit] [from: app/fonts/fa-regular-400.ttf] [copied] Entrypoint bundle 6.87 MiB = runtime.js 12.9 KiB vendor.js 6.51 MiB bundle.js 351 KiB runtime modules 2.72 KiB 8 modules orphan modules 356 bytes [orphan] 6 modules modules by path ./node_modules/@nativescript/core/ 1.4 MiB 162 modules modules by path ./node_modules/css-tree/ 318 KiB 113 modules modules by path ./app/ 128 KiB 9 modules modules by path ./node_modules/source-map/lib/.js 38.2 KiB 6 modules modules by path ./node_modules/reduce-css-calc/dist/ 131 KiB modules by path ./node_modules/reduce-css-calc/dist/lib/.js 11.1 KiB 3 modules modules by path ./node_modules/reduce-css-calc/dist/.js 120 KiB 2 modules modules by path ./node_modules/postcss-value-parser/lib/.js 9.11 KiB 5 modules modules by path ./node_modules/mdn-data/css/.json 242 KiB 3 modules modules by path external "~/.json" 84 bytes external "~/licenses.json" 42 bytes [built] [code generated] external "~/package.json" 42 bytes [optional] [built] [code generated] 4 modules webpack 5.49.0 compiled successfully in 6834 ms Webpack compilation complete. nativescript-plugin-firebase: /Users/chenj49/git/sample-app-reproduce-license/platforms/android/.pluginfirebaseinfo not found, forcing prepare! nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare! 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/sample-app-reproduce-license/node_modules/@nativescript/firebase/platforms/android/include.gradle' line: 96

@nativescript-community/licenses: 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. (/Users/chenj49/git/sample-app-reproduce-license/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 Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) generateLicenseReport failed


Appendix:
the steps for creating sample app

ns create sample-app-reproduce-license --vue --ts cd sample-app-reproduce-license ns plugin add @nativescript-community/licenses ns plugin add @nativescript-community/ui-lottie


- add Podfile at App_Resource/iOS/Podfile

FIX [The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0] warnning log

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' end end end


- add external setting to webpack.config.js

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();

};

- Add following code in app.ts to output license info to console log.

const licenses = require("~/licenses.json"); console.log(licenses);

farfromrefug commented 3 years ago

@coolboy0961 so you confirm this is an issue with the firebase plugin? If so as i told you i wont fix it from my side :s the firebase plugin completely rewrite your gradle files which is total madness. There is no way for me to ensure it would work :s If i understood wrong and it still fails without the firebase plugin, ping me again!

coolboy0961 commented 3 years ago

@farfromrefug

your plugin works well without the firebase plugin. I also confirmed that the firebase plugin add something in platform/android/app.grade like following image when I executed ios build. image

I will not ask you to change the firebase plugin but is there anyway to let the hook of @nativescript-community/licenses execute at the end of hooks? I manually add the things which is add by the firebase plugin automatically into the app.grade and then android build succeed. So, I think if I can let the firebase plugin change app.grade first, the hook of @nativescript-community/licenses should execute successfully.

image In view of this kind of plugin that modifies app.grade, could you consider putting the timing of plugin hook execution at the end?

farfromrefug commented 3 years ago

@coolboy0961 First there is no "order" in hooks so we cant set that. Second the order wont change anything as my hook does NOT modify the app.gradle. My hook simply injects itself at gradle build time through include.gradle. I dont know what firebase does and why the order would change anything.