android studio: when I want to edit a layout, garbage appears

1

I am new to Android Studio and some behaviors make me crazy like the following:

Until a few days ago in my project everything was fine when I found that when I entered any of the xml directories in the layout I found:

/* AUTO-GENERATED FILE.  DO NOT MODIFY.

     *
     * This class was automatically generated by the
     * gradle plugin from the resource data it found. It
     * should not be modified by hand.
     */
    package com.google.android.gms.identity;

    public final class R {
    }

The truth is that in reality, if I open the file from the Windows Explorer the content of the file is correct.

I already invalidated cache, deleted .idea and .gradle, clean and rebuild but still nothing.

How could I solve this?

    
asked by Roman 30.12.2018 в 04:16
source

2 answers

1
  

Until a few days ago in my project everything was fine when I found   that when entering any of the xml of the layout directory in your   content found. I already invalidated cache, deleted .idea and .gradle, clean   and rebuild but still nothing.

You mentioned that your project worked correctly, the problem you indicate can be caused by the following causes.

  • Failed to synchronize resource ids.

Occasionally performing Clean > Rebuild may not be enough, I advise you to delete the folders /build with this you really forced to build your project again.

  • There is a problem with the resources.

Android, "R's" red throughout the code

  • I see that you deleted the .idea and .gradle directories, however the advisable thing in this case is to eliminate the cache and restart.

    you have to perform the cache removal by:

File - > Invalidate Caches/Restart

    
answered by 31.12.2018 в 20:39
0

A thousand thanks ... you know how I solved that problem? modifying the date on which the xml files were modified. Can that be the reason for the problem?

Another contemporary problem that I'm having is that in the layouts designer I do not see all the properties of the objects ... will that be why?

regards, Roman

    
answered by 01.01.2019 в 19:20