'Flutter New Project Buile Error 18 Problem

I just new. when I created new flutter project, it show 18 error: that just always happen, but not at the first time I installing flutter

I also check the flutter doctor and there is no problem. Hope u can solve my problem.



Solution 1:[1]

You have to go to File --> Project Structure (crtl+alt+shift s) --> In the Project ,Modules section choose the sdk (android api) then Go to File --> Invalidate Cashes/Restart

Solution 2:[2]

Probably you are using a old version of the sdk (no null safety), so you can remove the ? after key parameter ou comment the line 8

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jalal W Bradosty
Solution 2 Lars Kuerten