Hi,
The CLI return error for duplicated ressources :
Bcryptjs comme with tow file in dist directory :
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
@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).
@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.)
This issue is not reproducible with bundle workflow and as in NativeScript 6.0 we'll support only this workflow, I'm closing it.