Error "Element linear layout must be declared"

Asked

Viewed 170 times

0

I would like a guidance for kindness am beginner in Android Studio. I searched many forums and many searches and found no solution days ago.

When I create a file inside the folder drawable following error occurs:

Element linear layout must be declared.

I noticed that this also happens when I create a folder with file or only file outside the folder layout but within the res. Already the files inside the layout no kind of mistake happens when I create a new one.

inserir a descrição da imagem aqui

  • 1

    Why you want to create a layout outside the layout folder?

  • 1

    @ramaral was going to ask the same.

1 answer

3


Layout files (Relativelayout and Linearlayout) should be inside the folder res/layout.

In this drawable folder you place image and Drawable Resources files, for example: layer-list, Shape, selector and etc...

You can check all accepted elements in this drawable folder in the Android documentation: Drawable Resources.

  • 1

    Thanks for the guidance.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.