Rebuild required after changing xml layout files in Android Studio

前端 未结 4 1198
甜味超标
甜味超标 2020-12-10 16:08

I am developing android applications and I am using Android Studio.

There is a problem though. When I change the source and I run the app it works fine, But

4条回答
  •  执念已碎
    2020-12-10 16:38

    The solution is not to have nested resources directories. Keep all your layouts under /res/layout/ folder. You can short them using some prefix like test_xxxx, or login_xxxx.

    Anyway, for some reason Gradle is only taking count of the changes in the layout main directory when it makes an incremental build. The changes in any other sub folder will not be noticed until you make a clean and a complete rebuild of the project.

    If anyone knows how to include resources sub-folders and avoid that problem at the same time please let me know...

提交回复
热议问题