I faced the same problem and so far, the only solution that worked for me was to use Visual Studio Code and open the folder that contains the project.
After resolving any potential dependencies, I was able to run the project.
That didn’t work for me. I have the Flutter plugin installed. I can create a new Flutter project. If I delete the project from the welcome screen project list, then try to import it fresh from file, Android Studio doesn’t know how to open it.
Did you try this?
Enable flutter plugin in Android Studio then it’s possible.
To install it:
Start Android Studio.
Open plugin preferences (Preferences>Plugins on macOS, File>Settings>Plugins on Windows & Linux).
Select Browse repositories…, select the Flutter plug-in and click install.
Click Yes when prompted to install the Dart plugin.
Click Restart when prompted.
Try to create a new flutter project to a new location, close the project, then just copy/paste the existing project source files (except .gitignore) into the new location (replace all).
Open the project again, go to the pubspec.yaml to do a packages get / Packages upgrade, then it should work
(Tested on Android Studio for Mac OS )
Otherwise, check if there is a local.properties file in your existing project (project/android/local.properties).
In my case it was missing, and after adding it manually , I could use the “Open existing Android Studio Project” correctly =)
local.properties file should contain something like this :
sdk.dir= [Android SDK Path]
flutter.sdk= [Flutter Path]
flutter.buildMode=debug
Otherwise, check if there is a local.properties file in your existing project (project/android/local.properties).
In my case it was missing, and after adding it manually , I could use the “Open existing Android Studio Project” correctly =)
local.properties file should contain something like this :
sdk.dir= [Android SDK Path]
flutter.sdk= [Flutter Path]
flutter.buildMode=debug
I have successfully imported the project in two ways. You can refer to my answer. https://stackoverflow.com/a/49974562/8163851