If you haven’t run your Flutter app yet, you might see Android Studio report a
build error when you open the android project. Run flutter pub get in
the app’s root directory and rebuild the project by selecting Build > Make
to fix it.

Editing Android code in IntelliJ IDEA

To enable editing of Android code in IntelliJ IDEA, you need to configure the
location of the Android SDK:

In Preferences > Plugins, enable Android Support if you
haven’t already.

Right-click the android folder in the Project view, and select Open
Module Settings.

In the Sources tab, locate the Language level field, and
select level 8 or later.

In the Dependencies tab, locate the Module SDK field,
and select an Android SDK. If no SDK is listed, click New
and specify the location of the Android SDK.
Make sure to select an Android SDK matching the one used by
Flutter (as reported by flutter doctor).

Click OK.