1

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.

faiziii
  • 371
  • 4
  • 11

6 Answers6

2

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 :

  1. Close and re-open (Restart) the android studio and try running app again.
  2. If step 1 is also not helpful then Uninstall app from your device , Disconnect and connect device again and rebuilt/Run app directly in your device again.

I hope this will work for you.

ghost talker
  • 402
  • 5
  • 15
0

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

Community
  • 1
  • 1
ChiHang
  • 126
  • 3
  • 11
0

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.

user6627139
  • 406
  • 6
  • 16
0

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.

Harry Mitchell
  • 1,100
  • 2
  • 7
  • 12
0

You can simply switch to project view and remove the build of the app:

enter image description here

Yasser AKBBACH
  • 539
  • 5
  • 7
0

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.