Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Document or fix .cordova/config.json #513

Closed
nofxx opened this issue Jan 15, 2015 · 7 comments
Closed

Document or fix .cordova/config.json #513

nofxx opened this issue Jan 15, 2015 · 7 comments

Comments

@nofxx
Copy link

nofxx commented Jan 15, 2015

There's no docs or mention to the file '.cordova/config.json'.

  {"lib":
    {"www":
      {"id":"com.phonegap.hello-world",
       "version":"master",
       "uri":"https://github.com/phonegap/phonegap-app-hello-world/archivemaster.tar.gz",
       "link":false}
   },"phonegap":{"id": XXXXXX}
}

Newbie catch: if you start a project with cordova create instead of phonegap:
[error] ENOENT, open '/home/nofxx/.../phonegap_project/.cordova/config.json'

Another catch: If you remove or change the app on build it will miserably fail #122

If it's meant to be a system/runtime file, it should be created accordingly.
Or document and create a example file for the user with what needs to go there.
(Do I need to keep that www: for instance?)

Related to #113

@mwbrooks
Copy link
Collaborator

Hi @nofxx,

Thanks for the suggestions.

The .cordova/config.json is generated by Cordova, but also not used by Cordova anymore. It's in a strange place with regards to Cordova's support.

Regardless, the PhoneGap CLI uses .cordova/config.json to store a few preferences and the main one is the PGB app ID. Based on your suggestions, I think we can improve the experience and remove some of the errors that you've referenced.

  1. Create .cordova/config.json when it doesn't exist.
  2. Remove and recreate the ID when the app is not found.

Also, the lib key is populated the Cordova tooling, yet it is never used. It should be safe to remove.

I'll add this as a task for next week!

@nofxx
Copy link
Author

nofxx commented Jan 16, 2015

@mwbrooks thanks for the explanation, crystal clear now.

1 & 2 are exactly what I mean, but let me add a suggestion:
Use something like .phonegap.json, .pgbuild or even .phonegap/config.json
So we could just rm -r .cordova, makes it more clear imho.

Thank you.

@si458
Copy link

si458 commented Jun 24, 2015

is the any update on this at all?
i managed to get around this by creating a blank config.json with just { } inside it

yarencheng added a commit to yarencheng/net.arenx.candidate.phonegap that referenced this issue Jul 16, 2015
.cordova/config.json is no longer in used.
Add a empty "{}" into it.
See phonegap/phonegap-cli#513
@ilhanyumer
Copy link

@si458 It doesn't help. It leads to other errors. http://imgur.com/a/DHiEa

@syardumi
Copy link

I ran into the same problem. I also fixed it with { }. Is there any update?

@muneebtator
Copy link

I was facing the same problem. Fixed it by creating .cordova folder and a config.json file inside it with {}

@mwbrooks
Copy link
Collaborator

Hi everyone, I believe commit 2c82089 should help to address this issue. It's now available on npm as phonegap@5.2.2.

Thanks for your patients and help in pointing this out!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants