Android layout subfolder and Instant run not working together

144 Views Asked by At

I configured my gradle project to read layout files from subfolders, but this makes Instant Run stop working.

The only way to see the changes is manually uninstalling the app and reinstalling it.

EDIT: is this bug. Is there any workaround for this?

1

There are 1 best solutions below

0
On

This looks like an issue with layouts in nested folders. When I was making changes to layouts in nested directories, I had to make clean before run - otherwise app ui remained unchanged. When I put my nested layout dirs before the general dir in build.gradle, the gradle started to see the change in layouts and pick them up without 'clean'.

    sourceSets {
               main {
                    res.srcDirs = [
                            'src/main/res/layout/nested',
                            'src/main/res'
                    ]
                }
                ...