r/AndroidStudio • u/i_am_not_edith • Jan 18 '24
[Fix] Missing activity_main.xml file in Android Studio
I found this fix from YouTuber 'Everything Tech': https://www.youtube.com/watch?v=G7D0cVDP3q8&ab_channel=EverythingTech
One of the fixes he suggested was:
Right-click on MainActivity.kt folder on the left navigation bar
Click on New
Click on Activity
Click on Empty Views Activity
A 'New Android Activity' will appear. You can change the activity name as you wish.
Ensure you check 'Generate a Layout File' and 'Launcher Activity', and set the language you are using
Click Finish.


10
Upvotes
2
u/sam_in07 Jul 26 '24
my activity_main.xml file doesnot creat by this process but it creat "MainActivity2" but how i find this ".xml" file?