Skip to content Skip to sidebar Skip to footer

Android Studio No Main Activity, No Layouts On A New Project

I installed new Android Studio. I created new Project and asked the wizard to create main activity. But there were no layouts, no main activity class, no nothing. Error on trying t

Solution 1:

After creating the project, you need to go to File menu and then Import Project. Then browse to the location of your project and import it. Then you will see all of these files and folders. I had this problem too, and it seems to be something that they overlooked in the newer versions of Android Studio (which is quite pathetic if you ask me).

Solution 2:

From what i learned is that you may be picking the "no layout" option when prompted to pick one. Try picking the basic activity and the rest of the files will show

Solution 3:

I don't know if anyone is having the same problem right now but i solved this issue by changing the Android Gradle plugin version and the Gradle version.

For doing this you have to open the project you're having issues with and click on File->Project Structure->Project and there you will see the two options. Android Gradle Plugin Version 4.0.0 and Gradle version 6.1.1 worked for me. After that I went to the file directory, right click on the package folder "com.example.myProject" and manually created an empty activity. The layout folder with my new activity was created automatically after that.

Solution 4:

I found it's because I changed the Java runtime version before through the Android Studio plugin Choose Runtime. I changed to JDK 8 from JDK 11 then the problem occured. It worked for me to change back to JDK 11 through plugin Choose Runtime.

Solution 5:

Try

  • Typing main activity (without quotes) in the search box and

  • Press enter.

For me it got restored. Search window is useful in finding many hidden tools quickly.

Post a Comment for "Android Studio No Main Activity, No Layouts On A New Project"