20

I deleted the android folder of my flutter project (Thought I could get rid of the errors that appear while running old projects).

How can I create that android folder? any commands?

1
  • Hm, what about creating a new flutter project with the same name in another folder. (flutter create <projectname>) and then copy the android folder in your old project. Commented Apr 27, 2022 at 9:03

4 Answers 4

49

Inside your project root, run:

flutter create . --platforms=android

This will (re) generate missing files or folders inside the android folder.


For all currently supported platforms:

flutter create . --platforms=android,windows,linux,web,macos,ios

Or simply:

flutter create .

To specify a package name, append:

flutter create . --platforms=android --org com.yourpackage.name

Flutter CLI reference.

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

2 Comments

I want to create an Android project with a specific package name. How can I do this? It creates with com.example.****. I don't want this package name.
You can specify with --org mypackage.name
21

The first command will recreate all folders like ios, android, windows, web, linux, and macos.

flutter create .

The second command will recreate android folder.

flutter create --platforms android .

The third command will recreate android and iOS folders.

flutter create --platforms android,ios .

Comments

0

Navigated to the root of my project and ran flutter create

Basically telling flutter to try and repair all the damaged and / or missing files in you project.

Comments

0

This will (re) generate missing files or folders inside the android folder.

For all currently supported platforms:

flutter create . --platforms=android,windows,linux,web,macos,ios

or simply do

flutter create .

or if you want to add package name

flutter create . --platforms=android,windows,linux,web,macos,ios --org com.yourpackagename.name

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.