Shanu
Shanu

Reputation: 655

How to recreate android folder in flutter project

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?

Upvotes: 17

Views: 21772

Answers (4)

Vivek Yadav
Vivek Yadav

Reputation: 151

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

Upvotes: 0

Alex
Alex

Reputation: 2364

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 .

Flutter CLI reference.

Upvotes: 38

Durga Sriram
Durga Sriram

Reputation: 486

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 .

Upvotes: 19

Bymolda
Bymolda

Reputation: 89

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.

Upvotes: 0

Related Questions