I am new to Flutter/coding. I am trying to work on my first project. I am following an online tutorial to create a weather app. I followed all the instructions but when I am running the app, nothing shows up on my emulator. There is an error on the Debug Console as below:
I tried to google the error and found that I need to update the kotlin version in the buildscript in the build.gradle file. But in my build.gradle file there is no buildscript section. See below:
I again googled for solution and I thought what if I add the code in my build.gradle file so I added the code with latest kotlin version 1.9.22 yet the error is still there.
Where am I going wrong.
I tried all solutions available in youtube and google. I have spent almost a day looking for it but no luck.
- I am running it on a windows 10, android emulator.


From my experience, Many times I have found that the latest Kotlin version is incompatible with the latest Flutter version.
Please, try to downgrade the version to
1.9.20or less. Also try stable versions like1.8.22, ...,1.7.10, or others. Pick one that suits your project the best from here: https://kotlinlang.org/docs/releases.html#release-detailsand also from your screenshot, I saw that the section below is missing in your android/build.gradle file.
Add this and update your Kotlin extension version accordingly: