[ 
https://issues.apache.org/jira/browse/CB-5648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13850728#comment-13850728
 ] 

Marcel Kinard commented on CB-5648:
-----------------------------------

Aha, you are right, Andrew. In cordova-android/lib/create.js, createProject() 
has defaults for the dir, package name, and class/activityName. However, 
bin/create invokes that as:

create.createProject(args._[0], args._[1], args._[2], args._[3], 
args['--shared']).done();

which being positional doesn't account for unspecified args in the middle. So 
Evan's classname was being interpreted as the package name, and that was 
failing the pattern-match check. With this code, unspecified args only work 
when they are at the end of the list, not the middle.

But I'm wondering on the appropriateness of default values for the classname, 
packagename, and dir. Those would only make sense for an internal prototype 
that never goes to an app store (I'm thinking collisions). And there isn't an 
easy CLI way to modify them after they've been created. Do we really want to 
support default values here? Are there use cases I'm missing?

> "cordova platform add android" fails with "Package name must look like: 
> com.company.Name"
> -----------------------------------------------------------------------------------------
>
>                 Key: CB-5648
>                 URL: https://issues.apache.org/jira/browse/CB-5648
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CLI
>    Affects Versions: 3.1.0, 3.3.0
>         Environment: OS X 18.3
>            Reporter: Evan Rowley
>            Priority: Minor
>              Labels: newbie
>             Fix For: 3.3.0
>
>
> I was making my way through the PhoneGap 3 Beginner’s Guide by Giorigo Natili 
> when I ran into the following error. Chapter 03 is on creating the HelloWorld 
> app. The steps that got me to the error are:
>     Step 1
> cordova create ~/the/path/to/src/ch03 HelloWorld
>     Step 2
> cd ~/the/path/to/src/ch03
>     Step 3
> cordova platform add android
>  ^ This command doesn’t seem to work. What I get from running this is:
> Creating android project...
> /usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
>                     throw e;
>                           ^
> Error: An error occured during creation of android sub-project.
> /Users/evanrowley/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
>                     throw e;
>                           ^
> Package name must look like: com.company.Name
>     at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
>     at ChildProcess.exithandler (child_process.js:641:7)
>     at ChildProcess.EventEmitter.emit (events.js:98:17)
>     at maybeClose (child_process.js:735:16)
>     at Process.ChildProcess._handle.onexit (child_process.js:802:5)
> I would really like to debug this but I don’t have the slightest clue as to 
> how my environment could be verified and/or how a node application can be 
> debugged. I took a look at q.js:126 and platform.js:244 and both basically 
> tie into some kind of exception thingy. It would be really neat if I could 
> run this in a ‘debug mode’ and see what all the variables are at certain 
> breakpoints.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to