cordova-cli icon indicating copy to clipboard operation
cordova-cli copied to clipboard

Plugins are not copied to platforms folders after delete repo, clone it again and build platforms

Open sylvestrevgen opened this issue 4 years ago • 5 comments

Bug Report

Problem

Plugins are not copied to platforms folders after delete repo, clone it again and build platforms

What is expected to happen?

Plugins is succesfully installed and worked in both platforms (Android and iOS). After delete repo locally and clone it again, plugins are successfully copied to platforms/ios and platforms/android.

What does actually happen?

After delete repo locally and clone it again, plugins are not copied to platforms folders. To fix this bug, I need to remove both platforms and add it again. After this, plugins are copied and works fine.

Information

Command or Code

Delete cordova app project, clone it again, install node modules, run cordova ios or android.

Environment, Platform, Device

iOS, Android

Version information

cordova CLI 10, cordova-android 9.1.0, cordova-ios 6.2.0

Checklist

  • [x ] I searched for existing GitHub issues
  • [ x] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above

sylvestrevgen avatar Apr 21 '21 11:04 sylvestrevgen

After delete repo locally and clone it again, plugins are not copied to platforms folders. To fix this bug, I need to remove both platforms and add it again. After this, plugins are copied and works fine.

Has Cordova ever installed the platform for you before? Using cordova platform add ... for the platform you intend to buiild. This was something a requirement for as long as I remember...

breautek avatar Apr 21 '21 12:04 breautek

Yes, all platforms has been installed before. After delete repo and clone it again, everything is fine but plugins folder is not defined in platforms/ios and platforms/android.

sylvestrevgen avatar Apr 21 '21 12:04 sylvestrevgen

Is there anything about this bug? Or it is not a bug and we need restart platforms everytime when clone repo on another laptop?

sylvestrevgen avatar Apr 22 '21 11:04 sylvestrevgen

For a team setup it's recommended to git ignore the following folders:

  • node_modules
  • plugins
  • platforms

When you clone the repo, the developer should:

  • npm install
  • cordova platform add

This way your project can be supported on different environments, for example you cannot work on an ios platform on windows/linux. It also makes sures that when npm install is used (behind the scenes), any native modules are installed for your specific environment.

I don't think this is a bug. Let me know what you think though. And if your flow worked before, can you give what cordova version it worked in?

breautek avatar Apr 22 '21 12:04 breautek

I am not sure about it worked before. I am going to try your advice. Thank you for quick answer.

sylvestrevgen avatar Apr 22 '21 12:04 sylvestrevgen