9

I tried grouping the layout for my Android project into several subdirectories. I was following this answer.

https://stackoverflow.com/a/32194963/688954

But somewhat the IDE complains URI is not registered and the Gradle build also says Error:Error: Unsupported type 'android.support.design.widget.CoordinatorLayout'.

Can anyone help?

I'm using build tools version 24.0.1

enter image description here

Community
  • 1
  • 1
Petra Barus
  • 3,589
  • 7
  • 41
  • 79

3 Answers3

0

sourceSets must be under android

android {
   ....
   sourceSets {
      main {
          ...
      }
}
Visttux
  • 116
  • 6
0

If you have used any underscore '_' in new resource directory name (/res/layouts-all/layout is proper, but /res/layouts_all/layout is wrong), please remove it. Do clean build. Then this error will be removed. I could solve my problem by this.

Kushal
  • 7,439
  • 7
  • 58
  • 76
0

Your xml file must be in the folder which is named "layout"

enter image description here

Buddy
  • 545
  • 4
  • 4