Skip to content

[Android] Error CLI from Bcryptjs #4513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kefahB opened this issue Apr 8, 2019 · 3 comments
Closed

[Android] Error CLI from Bcryptjs #4513

kefahB opened this issue Apr 8, 2019 · 3 comments

Comments

@kefahB
Copy link

kefahB commented Apr 8, 2019

Hi,

The CLI return error for duplicated ressources :

Bcryptjs comme with tow file in dist directory :

  • bcrypt.min.js.gz
  • bcrypt.min.js

If we remove the bcrypt.min.js.gz the is no problem .. but if we add new module the dependency's will be updated and the issu comeback !

"tns-android": {
      "version": "5.3.1"
    },
    "tns-ios": {
      "version": "5.3.1"
    }
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> [app/tns_modules/bcryptjs/dist/bcrypt.min.js] project_name/platforms/android/app/src/main/assets/app/tns_modules/bcryptjs/dist/bcrypt.min.js.gz        
[app/tns_modules/bcryptjs/dist/bcrypt.min.js] project_name/platforms/android/app/src/main/assets/app/tns_modules/bcryptjs/dist/bcrypt.min.js: Error: Duplicate resources

thanks

@NickIliev NickIliev added the bug label Apr 9, 2019
@NickIliev
Copy link
Contributor

@kefahB thank you for reporting this issue.

Confirming the behavior as reproducible with base NativeScript app.
Steps to reporduce:

tns create test-app
npm i bcryptjs --save
tns build

fails with

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> [app/tns_modules/bcryptjs/dist/bcrypt.min.js] D:\git\NS-Issues-2019-I\nativescript-cli\issue-4513\platforms\android\app\src\main\assets\app\tns_modules\bcryptjs\dist\bcrypt.min.js   [app/tns_modules/bcryptjs/dist/bcrypt.min.js] D:\git\NS-Issues-2019-I\nativescript-cli\issue-4513\platforms\android\app\src\main\assets\app\tns_modules\bcryptjs\dist\bcrypt.min.js.gz: Error: Duplicate resources

The workaround suggested by @kefahB is working (remove the *.gz file from node_modules and rebuild the app with deleted platforms folder).

@rosen-vladimirov rosen-vladimirov added this to the 6.0.0 milestone Apr 9, 2019
@NickIliev
Copy link
Contributor

@kefahB the issue is also not existing when making a Webpack build with bundle

For example

tns create test-app
npm i bcryptjs --save
tns build android --bundle

The above is working as expected. Btw as in the future releases, we are heading for Webpack by default experience, you should consider using the bundle flag for all your builds (there are only benefits for using bundling including smaller size, faster builds, etc.)

@rosen-vladimirov
Copy link
Contributor

This issue is not reproducible with bundle workflow and as in NativeScript 6.0 we'll support only this workflow, I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants