Package.json is being modified after cordova build android
See original GitHub issueDescription:
I work in a windows environment with vscode where all files need to end with CRLF
, so this configs are made:
.editorconfig
theend_of_line
property is set tocrlf
git
uses crlf.prettierrc
has"endOfLine": "crlf"
- vscode config has
"files.eol": "\r\n"
and"prettier.endOfLine": "crlf"
All work as expected except for when you build (or run) the project on device. > cordova build android
the package.json
file is edited and stripped from the last empty line. That leads git say changes where made and the tree is not clean.
Steps to Reproduce:
- Make a clean cordova project (or if you use Ionic as I do, then an ionic empty project)
- Set eol to crlf
- Add platform Android
- Make sure
package.json
has a empty new line in the end. - Run
cordova build android
Output:
I had this problem with cordova version 8.0.0 and right now with 8.1.2
Edit: As per this comment, this problem also happens in iOS
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Phonegap 7 is messing with package.json - Stack Overflow
I have found a workaround to overcome this since it seems that we have to manually exclude the packages of cordova when building...
Read more >Creating your first Cordova app
The Cordova command-line tool is distributed as an npm package. ... Run the following command to build the project for all platforms: $...
Read more >Building a Tabris.js App - Tabris.js Documentation
Tabris.js utilizes Apache Cordova to build and package apps. ... app on your local machine, you need to setup developer tools like Xcode...
Read more >Differentials - Appflow - Ionic.io
No, If the native build does not contain the manifest file, it is impossible for the deploy to know which files are already...
Read more >Android App Development Guide - Ionic Framework
We don't recommend using Android Studio for developing Ionic apps. Instead, it should only really be used to build and run your apps...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created a plugin to solve this issue.
https://github.com/arzyu/cordova-plugin-package-json-guard
Affecting iOS too