问题
I have a library project in Android Studio that has been working fine, but today I went to work on it and all of the files are missing except for a few git files. The folders/files are there when I look in the project's folder on my hard drive, they just aren't displaying in Android Studio. Here is a screenshot:
I tried reinstalling and updating Android Studio, but it didn't work. Any ideas as to what is going on here? How can I fix it?
回答1:
Try Import Project...
and navigate to your project. Select build.gradle
file.
Be sure to wait for a while, so that android studios can load all your stuff. Sometimes a restart will help, but since you reinstalled it, that shouldn't be the problem.
回答2:
Go to File > Project Structure > Project Settings > Modules.
Click on the green colored + and add new module. select Application module and set the content root to your project module.
Click next and then finish.
This should do the trick and the complete project structure will appear. It worked for me.
回答3:
I had to Sync Project with Gradle Files
in Android Studio to get my files back after they disappeared in Android Studio's Project
window.
回答4:
Go to
File > Project Structure> click on + > then set it to android
回答5:
In my case i have a slash in the subproject settings.gradle
As an example, this did not work:
include ":somedir/library"
But changing it to this fixed it:
include ":somedir-library"
project(":somedir-library").projectDir = new File(settingsDir, "somedir/library")
来源:https://stackoverflow.com/questions/27082379/android-studio-project-files-not-showing-up