I have tried upgrading flutter to the latest version. I am still getting the same error.

- 427
- 1
- 4
- 15

- 199
- 1
- 1
- 3
-
Please mark the thread as solved – Syed M Abbas Haider Taqvi Feb 17 '23 at 09:33
5 Answers
I was getting the exact same error.
After Renaming my working directory as per the naming convention attached by the Flutter team here which @Rushikesh just mentioned. It worked for me..
The reason is that the Flutter SDK uses directory/folder names as packages names and I was using a hyphen in my directory name.
In your case mybmicalculator
or my_bmi_calculator
might work instead of myBmiCalculator
.
Give it a try, that might be one of the errors.

- 485
- 3
- 9
Package names should be all lowercase, with underscores to separate words, just_like_this. Use only basic Latin letters and Arabic digits: [a-z0-9_]. Also, make sure the name is a valid Dart identifier -- that it doesn't start with digits and isn't a reserved word.
see this - https://dart-lang.github.io/linter/lints/package_names.html

- 1,515
- 4
- 16
- 32
I think your app's folder name has some capital letters, any digit at the start, or something like that. I faced this as my app's folder name had capital letters and when I used all small letters the problem was solved.

- 1,287
- 1
- 9
- 20
Don't use a capital letter at the beginning of your app name like this: flutter create Appname
. You may encounter an error if you create a Flutter app with a capital letter at the beginning. To avoid errors, always use this method: flutter create appname
, without a capital letter at the start.

- 72
- 1
- 9
in my case the android folder is missing and flutter create . is also not working how i fixed my problem is .
- copy the android folder from any project.
- re-open the project and everything works fine

- 55
- 7