The problem is caused by missing .iml
project files. These files are added automatically to the .gitignore
file but they should not. To fix it:
- Delete
.idea
folder. - Create a new temporary Flutter project with the same name.
- Copy from the project to your existing project these 2 missing files:
[project_name].iml
android/[project_name]_android.iml
- Open Android Studio and the problem should be gone.
To avoid it in the future, make sure .iml files are not excluded in the gitignore. There is a Github issue on this topic.
Latest posts by Sushant Kumar (see all)
- What is On-Page Optimization and Off-page Optimization - March 14, 2024
- [SOLVED] Flutter : PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) - December 7, 2021
- [Solved] Flutter : Error: The getter ‘subhead’ isn’t defined for the class ‘TextTheme’ from package:flutter/src/material/text_theme.dart’ – searchable_dropdown - December 6, 2021