Reputation: 381
When I do any changes in xml layout file, it doesn't reflect with new compilation build although R.java is generated but when I run the application changes doesn't reflect. I need to rebuild the whole project which is taking time. Any help on this?
I guess before it was working fine.
Upvotes: 1
Views: 6800
Reputation: 146
After a few days of fighting this issue, I solved it by deleting all "v26" directories inside the "res" directory, since the activity was using it instead of the usual "layout" directory for accessing the xml.
app/src/main/res/layout-v26/ had to be deleted and you should remain only with app/src/main/res/layout/
Anyway, I am new to android development and am not sure if this can lead to other issues, so be careful.
Upvotes: 2
Reputation: 1038
You can simply switch to project view and remove the build of the app:
Upvotes: 0
Reputation: 1130
This sounds similar to my situation. I had an extra quote character in my colors.xml file, which caused errors when I tried to run my app. What worked for me was to remove the extra quote in my colors.xml file. Then I saved the file. Then I restarted Android Studio.
Upvotes: 0
Reputation: 416
I "touch" AndroidManifest.xml and that forces a build. Does not take nearly as long as rebuilding project or restarting emulator. It's a hack, but hey, it's my hack.
Upvotes: 0
Reputation: 392
Yes Sometimes it also happens to me. If you are doing changes i right way in the Xml file then those must be appear when you run your app. But if it does not happen, then you need to rebult your application, or clean it several time. if it also does not work to you then do the follwoing :
I hope this will work for you.
Upvotes: 2
Reputation: 136
Pleas check if you have enabled Power save mode (File -> Power Save Mode) which turn off auto compilation
Android Studio - Auto complete and other features not working
Upvotes: 0