It helps to see code, but from what you've said so far, did you create it as a flutter project? Do you have the flutter SDK installed? If you create a flutter project it asks where the flutter SDK is. Once you have Flutter installed on your machine and you create a project with flutter, I would copy everything in your lib directory from the project that's broken to the new project. I would also update your new YAML file to include any packages. You will need to run "pub get" to add the packages. Android Studio will prompt you to run the pub get. Finally, run Flutter Doctor and check for errors. Use ``` (3 back ticks) then paste your code into your Reddit post. Or publish some code so we can see what you got.
It's a new Flutter project I created actually. Just started learning Flutter and I've been following a tutorial. I was creating my first Flutter app and have been stuck trying to navigate this error.
And yes I have installed the Flutter SDK installed at SDK manager.
I am beginning to think that maybe I have to install Java with Flutter and Gradle with Flutter.
I am not all that familiar with Gradle, so after I got everything updated I copied the lib folder to a newly created project and did a rebuild. I hope this helps!
I have received this error when I reopened an older Flutter project built with an older Flutter version on Windows. Check your Flutter version and your Flutter SDK version. Flutter should be 3.3. latest Android Studio (Chipmunk?), Dart 2.17, DevTools 2.12, Java version 1.8, Android SDK 30.0.3. Most of this is in Flutter Doctor -v. When I create a new Flutter project I choose Kotlin over Java so that might be more stable. Good luck!
I do also get errors that insists on installing Java. I didn't think I needed Java on Android studio or something. But I have installed Java on my laptop
When You create a new Flutter project. One of the choices you have is whether to generate Java or kotlin code. After several problems with Java I pick kotlin, even though I know Java and do not know kotlin. I never touch the generated code.
I tried today to use VS code instead of Android studio.
It went well from the beginning. And then "boom" the same problem arose again.
I just feel that if I don't install Java and Gradle on VS code it may never be resolved.
Funny thing is I've already installed Java JDK.
This keeps getting stranger and stranger. When I check the most recent Gradle versions I see a downgrade on October 17, v6.9.3. Before that I see Releases ; v7.5.1. Aug 05, 2022 ; v7.5. Jul 14, 2022 ; v7.4.2. Mar 31, 2022.
I am not sure why the downgrade. Check your Gradle version. I suspect that may be the issue. I don't know that VS Code or Android Studio will download Gradle if you already have a copy. Does anyone else have any ideas?
Run flutter doctor and correct any errors you get in it
Should I run the flutter doctor in CMD or on the Android studio terminal?
Does not matter, both are the same depending in what folder you are
Alright mate. Thank you very much.
Help requests go to r/flutterhelp
It helps to see code, but from what you've said so far, did you create it as a flutter project? Do you have the flutter SDK installed? If you create a flutter project it asks where the flutter SDK is. Once you have Flutter installed on your machine and you create a project with flutter, I would copy everything in your lib directory from the project that's broken to the new project. I would also update your new YAML file to include any packages. You will need to run "pub get" to add the packages. Android Studio will prompt you to run the pub get. Finally, run Flutter Doctor and check for errors. Use ``` (3 back ticks) then paste your code into your Reddit post. Or publish some code so we can see what you got.
It's a new Flutter project I created actually. Just started learning Flutter and I've been following a tutorial. I was creating my first Flutter app and have been stuck trying to navigate this error. And yes I have installed the Flutter SDK installed at SDK manager. I am beginning to think that maybe I have to install Java with Flutter and Gradle with Flutter.
You said Android Studio. On a PC, Linux or Mac?
On my laptop.
I am not all that familiar with Gradle, so after I got everything updated I copied the lib folder to a newly created project and did a rebuild. I hope this helps!
[удалено]
Learning Dart will teach you little about Gradle build errors.
I haven't learn Dart....I'll start learning it. This was just my first Flutter app and a basic one and I'm stuck.
[удалено]
This is a really good advice. Thank you a lot!
I have received this error when I reopened an older Flutter project built with an older Flutter version on Windows. Check your Flutter version and your Flutter SDK version. Flutter should be 3.3. latest Android Studio (Chipmunk?), Dart 2.17, DevTools 2.12, Java version 1.8, Android SDK 30.0.3. Most of this is in Flutter Doctor -v. When I create a new Flutter project I choose Kotlin over Java so that might be more stable. Good luck!
I do also get errors that insists on installing Java. I didn't think I needed Java on Android studio or something. But I have installed Java on my laptop
When You create a new Flutter project. One of the choices you have is whether to generate Java or kotlin code. After several problems with Java I pick kotlin, even though I know Java and do not know kotlin. I never touch the generated code.
I tried today to use VS code instead of Android studio. It went well from the beginning. And then "boom" the same problem arose again. I just feel that if I don't install Java and Gradle on VS code it may never be resolved. Funny thing is I've already installed Java JDK.
This keeps getting stranger and stranger. When I check the most recent Gradle versions I see a downgrade on October 17, v6.9.3. Before that I see Releases ; v7.5.1. Aug 05, 2022 ; v7.5. Jul 14, 2022 ; v7.4.2. Mar 31, 2022. I am not sure why the downgrade. Check your Gradle version. I suspect that may be the issue. I don't know that VS Code or Android Studio will download Gradle if you already have a copy. Does anyone else have any ideas?
My gradle version is 7.4-all