I am new to Android Studio and can't seem to get my xml document to work, the KT file runs fine but I am not able to get my design view to display for me to add more textboxes/constraints. I have tried almost everything online to find a solution. Even the "Invalidate Cache/Restart" method I did. Still nothing. Now I have just errors on line 2 saying "element <androidx.constraintlayout.widget.ConstraintLayout must be declared" and I get another error for every TextView and EditText in the code. Please help me with what I may be doing wrong or even if its a simple thing.
1 Answer 1
The Mainfest file is not supposed work like that. Check this out to know more about the Manifest file: https://developer.android.com/guide/topics/manifest/manifest-intro
All of your design part, like the layouts for every activity/fragment should mostly be inside the res>layout. Notice the setContentView in your MainActivity.kt, it includes the activity_main.xml file which is where you should put your design(XML) code.
manifest.xmlinto youractivity_main.xmlwhich is under res-> layout. You can easily access it by clicking onactivity_mainin your class, click should bectrl+left mouse click. With the new project, you can copy its manifest in your existing project's manifest.xml to correct it, don't forget to change your app name in it, other things will be same for a new project. This will fix the errors.