poetic/ember-cli-cordova

cordova-init failing on cordova 5.1.1

Closed this issue · 6 comments

hashg commented

I'm using latest ember-cli-cordova ember install git://github.com/poetic/ember-cli-cordova.git#master

When I execute cordova-init ember g cordova-init com.hgowda.ember-cdv5 following error happens

version: 0.2.7
installing
[?] Overwrite config/environment.js? Yes, overwrite
[?] Overwrite .gitignore? Yes, overwrite
  overwrite config/environment.js
  overwrite .gitignore
Creating Cordova project.
App id contains a reserved word, or is not a valid identifier.

Error thrown while running shell command: "cordova create cordova com.hgowda.ember-cdv5 EmberCdv5"
Error: Command failed: /bin/sh -c cordova create cordova com.hgowda.ember-cdv5 EmberCdv5
App id contains a reserved word, or is not a valid identifier.

    at ChildProcess.exithandler (child_process.js:751:12)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Socket.<anonymous> (child_process.js:1183:11)
    at Socket.emit (events.js:107:17)
    at Pipe.close (net.js:485:12)

This task seems to be creating the issue, app name need to be changed from cordova to unique name since it's a reserved word now.

'cordova create cordova ' + config.id + ' ' + config.name;

Error: App id contains a reserved word, or is not a valid identifier.

So seen this issue on other projects and seems as the dash in your identifier "com.hgowda.ember-cdv5" is the issue. You can go around by initiating with a regular id name like "com.example.hello" and then rename in the config.xml before it adds any platforms.

Hidden in the error there is why this is happening which matches up with what @rudymacias said.

App id contains a reserved word, or is not a valid identifier.

I don't think this is a bug.

hashg commented

@jakecraige @rudymacias Please share the working init command which you're currenty using on Cordova 5.x.

I thought error is because of this -

Error thrown while running shell command: "cordova create cordova com.hgowda.ember-cdv5 EmberCdv5"

We are always naming the folder name as 'corodva' which is a reserved word now?.

@hashg The issue is the dash - in the app id you are giving it. Try something like:

ember g cordova-init com.hgowda.embercdv5

Right exactly @jakecraige. @hashg use the command line like he's mentioning.

hashg commented

ember g cordova-init com.hgowda.embercdv5. Worked.