Cannot find R.layout.activity_main
If your XML's contain errors your generated file might not build try erasing most of their content and making sure id's and file names are not duplicated and no capitals and spaces are used. If it works you can start adding stuff.
AndroidStudio Cannot Find Layout
I am facing the same problem. I just Restart Android studio with invalidate Cache and it's work for me.
But when I use the stable version for
Android studio 3.6 it perfectly works for me.
Android Studio: Cannot find the 'design view' section after updating to ver. 3.5.1
There are various reasons for Design view to fail to render layouts.
You can try the following:
- Make sure XML representation of layout is error free.
- Try changing the API levels in the design views.
- Clean build your project by going to
Build > Clean build
- Ensure you don’t have any file from SDK that is missing
- If everything is proper still if android studio is
not able to render your layout invalidate cache and restart android
studio by going to
File > Invalidate Cache/Restart
I know I have mentioned too many steps but since there isn’t a description for your question and its little hard to determine the exact reason why it happens.
Why can't i find the layout I have created my MainActivity.java file?
This is common problem which occurs with Android Studio!
Its not your problem, it is bug of Android Studio!
To resolve this, Just Clean your project and Restart Android Studio!
Cannot find R.layout.activity_main in main activity.java
I invite to you to clean project and rebuild again, you have the how to here.
And remove those imports that contains
R in your project.
I see you have this :
Change it to :
This is problem of your library, take a look on this answer, try it, if it does not work.. just change the library.