After cloning a git repository with GitKraken (https://github.com/cloudwebrtc/flutter-webrtc) and opening it in Intellij it marks every file as "Non-Project Files" (Brown background).
Everything builds and runs as intended but it is kinda annoying.
I tried git checkout using IntelliJ instead, but it didn't help.
How can i fix this?
Solution 1: Andrew
File -> Project Structure (Or press Ctrl+Alt+Shift+S)
Project Settings -> Modules
By default, it will be set as
- Source Folders:
- Test Source Folders:
- Test Resources Folders:
- Excluded Folders:
If that doesn't clear it up, you may need to adjust where IntelliJ thinks the project directory is in the settings.
Solution 2: Peter
Intellij does not find any source, test or resource folders, because the project you open is not a gradle or maven project. Nor does it have a
src folder at the root as.
Gradle tool window and click on the plus button at the top :
flutter-webrtc/android/build.gradle file to import the android project as a module.
As an alternative, open the android project directly via
Files > Open.
Solution 3: Ryker
Extremely late answer but I just ran into this for my project and realized that the name of my project had dashes like yours which is an invalid module name for IntelliJ. So I just changed the project folder name which solved my issue.
Solution 4: Joel Broström
Remove the .idea folder in the project root and restart android studio to regenerate it.
Make sure to save a copy somewhere since this will remove your workspace.xml file with all your local project configurations such as code run configurations, custom scoops etc.
Replace workspace with the old file and add all missing files from the old to the new folder.
Edit: It might be enough to just remove .idea/vsc.xml and restart Android Studio.
Solution 5: AbdullahA
Go to File -> Repair IDE
Then in the notification that appears at the bottom right click "Rescan Project Indexes"
Solution 6: Danish Mehmood
the same thing happened to me when I was working with webstorm and pushing changes to github. I a came to know that
.idea folder is pushed too, I was noob at that time, I manually deleted the
.idea folder by opening gihub remote repo. And then when I locally did
git add files and
git commit -m "message", it refused to push. I was shocked what the h**** is this, I, then restarted webstorm, and wallah, everything was back.
so the solution to your problem is
restart your IDE IntelliJ as I did Webstorm