Audrey So commented on CB-11990:


Hi Yuliia!

Thank you for providing me with step-by-step directions. That was really 
helpful and I appreciate the time you took to do that for me. I went ahead and 
followed each step. Here is what I found:

cordova 6.3.0
When I am removing a platform (cordova platform remove android), the platform 
“android” directory is removed, however my platforms.json file is not deleted. 
Instead my platforms.json file is just empty. Only my platforms “android” 
directory is removed. (I experience the same things in both 6.3.0. and 6.3.1).

I then manually removed platforms.json, but cordova prepare does not bring it 
back this way. Instead, delete the entire “platforms” directory. Then, when you 
use “cordova prepare” , everything including the platforms.json will be 
restored for you. One of cordova prepare’s purposes is to restore 
platforms/plugins that have been saved to config.xml if the 
directory/directories have been deleted. (In the “platforms” directory, you can 
also delete platforms.json and the “android” directory and run cordova prepare 
to get the same result as it will regenerate the platforms directory for you 
based on what has been saved in config.xml.) 

To test this, (1) create a cordova project, (2) add a new platform (android, 
etc) with cordova platform add android —save (that platform is now saved to 
config.xml), (3) delete the entire “platforms” directory with rm -r platforms, 
(4) run cordova prepare… here you should see that entire directory with the 
platforms.json restored. This process works the same way for plugins, too. 

Let me know how this works for you! Thanks! — Audrey

> Cordova prepare doesn't restore android.json and ios.json
> ---------------------------------------------------------
>                 Key: CB-11990
>                 URL: https://issues.apache.org/jira/browse/CB-11990
>             Project: Apache Cordova
>          Issue Type: Bug
>    Affects Versions: 6.3.1
>            Reporter: Yuliia Mykhailova
>            Assignee: Audrey So
> If the platform specific .json of plugins was removed, cordova prepare 
> command doesn't re-create it, and as a result doesn't add plugins since 6.3.1 
> version, 6.3.0 is okay.
> [UPD] more detailed steps to reproduce:
> - install cordova@6.3.0
> - go to project with platform and plugins installed
> - do cordova platform remove android (or ios, doesn't matter) -> platform is 
> removed, <platform.json> file is removed
> - do cordova prepare -> platform is added, <platform.json> is recreated, 
> therefore plugins are added to the fresh created platform.
> - install cordova@6.3.1
> - do same steps
> - on a last step the <platform.json> is not recreated, therefore platform is 
> created but no plugins are added.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to