The layout in layout has no declaration in the base layout folder [error]

前端 未结 22 2833
粉色の甜心
粉色の甜心 2021-01-31 13:05

After migrating to Android Studio 3.2, API 28, I am getting the following error on my app\'s layout:

The layout in layout has no declaration in the base lay

相关标签:
22条回答
  • 2021-01-31 13:33

    I had copied the xml files in the folder using Windows Explorer. It seems to have caused an encoding issue. After deleting the files and coping them inside Android Studio, the problem was resolved.

    0 讨论(0)
  • 2021-01-31 13:36

    I just did Build > Clean Project

    0 讨论(0)
  • 2021-01-31 13:36

    Note that when you are using different versions of layout like (Large/Small/Nornal) then that case you have to same main layout folder. like this way

    0 讨论(0)
  • 2021-01-31 13:37

    I received this error when moving layout files between Gradle modules. I didn't have to go so far as to invalidate caches as it resolved itself when I restarted Android Studio and cleaned the project. It seems likely to be an IDE bug.

    0 讨论(0)
  • 2021-01-31 13:38

    This issue seems to be happening because studio or compiler is not able to find the resource file inside the base layout folder. To solve the problem you might need to create the file into different layout folders. If you are using layout folders v21, v25 etc. folders for designing layouts for different target devices then you also might need to place your resource files there too.

    0 讨论(0)
  • 2021-01-31 13:43

    In my case this warning appeared due to "wrong" character (dot) used in value name:

    <dimen name="dp.divider.xlarge">24dp</dimen>
    

    Removing dots (right click on a name, then Refactor-Rename in Android Studio) resolved the problem.

    0 讨论(0)
提交回复
热议问题