1

I cannot create a android project via cmd.

The following error is shown:

flag -- is not valid

I tried to execute the following code

According to android training website

android create project --target <target-id> --name MyFirstApp \ --path <path-to-workspace>/MyFirstApp --activity MainActivity \ --package com.example.myfirstapp

1 Answer 1

2

Sounds like you've added a space somewhere you shouldn't or had trouble substituting the stuff in <> with actual values, or maybe been confused by the newlines.

Here is a command with just one line that I just ran on OSX that successfully created a project in ~/MyFirstApp.

android create project --target "android-17" --name MyFirstApp --path ~/MyFirstApp --activity MainActivity --package com.example.myfirstapp

This should work for you, assuming you have the android-17 SDK installed. If you have another SDK installed, then you'll have to change the number to represent the SDK you have installed. (run android list targets to see which ones you have)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.