My Android Studio project was doing some funny business with the preview mode. I was getting lots of errors in regards to rendering the views. In just one Activity I would get about 50 errors. Long Story Short: I spent all day searching for a solution to no avail, but noticed that these errors only happen to that particular project. I thought - you know what, I'm just going to delete all the Android generated stuff and re-import my src files into a new project.
So I deleted them, but now I don't know how to import the src folder back into Android Studio! When I tried to import, Android does not create a gradle build for me. This is what I've tried:
In Project Explorer -> Android window - no files are present. In Project Explorer -> Project window - files are present but has a red marking on them, I have no idea what they mean.
The run, build, debug buttons etc are all greyed out. This tells me that the Gradle build wasn't successful.
Anyway, after I restarted AS, I now get this event log:
Migrate Project to Gradle? This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
Why do I need to migrate? I told Android Studio to build gradle by pointing to the local gradle build?
What is the correct way to create a Android Studio project if you have source codes but not as an existing project in eclipse or android studio?
Maybe you should create a new project, then paste source files.