6

I just switched to Android-Studio from Eclipse. I am trying to run my application after setting up the gradle files. The project builds with no errors, however I can not run my app because there are no android facets found.

enter image description here

When I go to project structure there are no facets and I do not see any way to add a facet. How can I run my application?

enter image description here

rhodysurf
  • 357
  • 1
  • 4
  • 12
  • perhaps: http://stackoverflow.com/questions/17625345/no-android-facet-found-issues-compiling-with-android-studio-0-2 ? – Bram Feb 10 '14 at 14:20
  • This does not work for me because there is no facets menu under project structure as that answer suggests @Bram – rhodysurf Feb 10 '14 at 14:22
  • You don't have to manipulate facets manually in Android Studio, this bug notwithstanding. Perhaps click the "Sync Project with Gradle Files" button after manually changing the build files? – Scott Barta Feb 10 '14 at 17:43
  • It syncs and builds fine, but there are no facets. This project previously built in eclipse just fine. – rhodysurf Feb 10 '14 at 23:59
  • Hey guys just found this on [SO][1] it worked for me! [1]: http://stackoverflow.com/questions/17625345/no-android-facet-found-issues-compiling-with-android-studio-0-2 – Paradela Apr 22 '14 at 22:12
  • I had seen that answer but my problem was that I could not add facets manually either – rhodysurf May 07 '14 at 16:14

4 Answers4

20

I solved it by removing the .idea folder and any .iml files and then re-import the project into Android Studio.

If after importing you end up with the error No facet found in module you need to follow this steps

Go to Run/Edit Configurations and you will see at lest two configurations one with the name of the original name my project: lets call it helloWord and another called app

The one with the original name helloWord was having this problem, but the configuration called app worked fine (I was able to run it)

So delete the setting with the facet problem helloWord and renamed the one called app back to the name of my project helloWord

Mauricio Gracia Gutierrez
  • 10,288
  • 6
  • 68
  • 99
Heinrisch
  • 5,835
  • 4
  • 33
  • 43
1

Th solution for me was to create a new project in android-studio. Then, copy over the code, resources, and dependencies to the new project. Then finally update the Gradle files manually and sync. Not perfect, but it worked and I can now upload to my device.

EDIT: This works but the method marked as the answer is what I was looking for.

rhodysurf
  • 357
  • 1
  • 4
  • 12
0

Invalidate cache and restart worked for me.

deepThought
  • 699
  • 4
  • 26
-2

I just solved my problem with the following steps, walk through with me:

1) File -> Project Structure, or press (Ctrl+Alt+Shift+S) shortcut to open "Project Structure".

2) Select Facets which is under the Project Settings tab. (First column)

3) Click on + button which is at the top of the Second Column to add new facets.

4) Select Android facet from that Add menu which will prompt another dialog box to select a module. (Select a module to which you want to apply this facet).

5) Select your module and that's it.

Happy Coding!! ;)

Shayan Amani
  • 5,787
  • 1
  • 39
  • 40