0

I have upgraded my Android studio to 2.9 and I have been getting this error when I try to run my code.

Restart Error: No Android facet found for main

On surfing the web , I found this solution

No Android facet found, issues compiling with Android Studio 0.2

But the new Android studio does not have these options in the 'Project Structure'. Can anybody suggest any fix?

Community
  • 1
  • 1
Code_Yoga
  • 2,968
  • 6
  • 30
  • 49

2 Answers2

1

Try to open Project Structure of your project (right click on project -> Open Module Settings), and check if in Facets is added your project, if not - " + " add it. Its worked for me...

0

There is already an update for AS 0.2.10. Try to update AS.

And if you still get the same error:

I don't know if this will help but you also could try to import your project instead of opening it (-> your *.iml files will be generated new by as). But be careful, you have to select the right file: settings.gradle.

owe
  • 4,890
  • 7
  • 36
  • 47
  • Thank you I have updated Studio to 0.2.10 and tried, no luck. I created a new project and moved my old code, only then I could make it work. – Code_Yoga Oct 01 '13 at 06:18
  • I assume that importing the project by selecting the file 'settings.gradle' should also work. – owe Oct 01 '13 at 06:53
  • On Importing the project using 'settings.gradle', I am getting 'Restart Error: Module is not found' – Code_Yoga Oct 01 '13 at 10:13
  • did you include the module in the `settings.gradle` file? – owe Oct 01 '13 at 11:51
  • for reasons I am unaware of, everything is back to normal now :) – Code_Yoga Oct 01 '13 at 11:55
  • ok :) I just wanted to know if this would work! I also had a few times where AS is a little bit magic :) – owe Oct 01 '13 at 11:57