Android studio strange behaviour with some files appearing different than how they are











up vote
0
down vote

favorite












I have a problem with Android Studio that happened all of a sudden today when I opened AS.
As you may see in the pictures, some files are strange.
In this picture you may see that some of the .java files have different icon



enter image description here



And totally wrong content
enter image description here
Same thing happens with SOME of the XML files which have different content
enter image description here
Also some of the PNG images are not displayed in AS.
All files are ok, if for example I open them externally (notepad...) they are ok (luckily).
Is there a way to fix it?
I've already tried to invalidate cache/restart but it didnt work.
Thanks










share|improve this question






















  • I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
    – Ben P.
    Nov 7 at 22:47










  • @Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
    – CalCon
    Nov 7 at 23:05










  • Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
    – CalCon
    Nov 8 at 12:15















up vote
0
down vote

favorite












I have a problem with Android Studio that happened all of a sudden today when I opened AS.
As you may see in the pictures, some files are strange.
In this picture you may see that some of the .java files have different icon



enter image description here



And totally wrong content
enter image description here
Same thing happens with SOME of the XML files which have different content
enter image description here
Also some of the PNG images are not displayed in AS.
All files are ok, if for example I open them externally (notepad...) they are ok (luckily).
Is there a way to fix it?
I've already tried to invalidate cache/restart but it didnt work.
Thanks










share|improve this question






















  • I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
    – Ben P.
    Nov 7 at 22:47










  • @Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
    – CalCon
    Nov 7 at 23:05










  • Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
    – CalCon
    Nov 8 at 12:15













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a problem with Android Studio that happened all of a sudden today when I opened AS.
As you may see in the pictures, some files are strange.
In this picture you may see that some of the .java files have different icon



enter image description here



And totally wrong content
enter image description here
Same thing happens with SOME of the XML files which have different content
enter image description here
Also some of the PNG images are not displayed in AS.
All files are ok, if for example I open them externally (notepad...) they are ok (luckily).
Is there a way to fix it?
I've already tried to invalidate cache/restart but it didnt work.
Thanks










share|improve this question













I have a problem with Android Studio that happened all of a sudden today when I opened AS.
As you may see in the pictures, some files are strange.
In this picture you may see that some of the .java files have different icon



enter image description here



And totally wrong content
enter image description here
Same thing happens with SOME of the XML files which have different content
enter image description here
Also some of the PNG images are not displayed in AS.
All files are ok, if for example I open them externally (notepad...) they are ok (luckily).
Is there a way to fix it?
I've already tried to invalidate cache/restart but it didnt work.
Thanks







android android-studio






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 22:41









CalCon

1117




1117












  • I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
    – Ben P.
    Nov 7 at 22:47










  • @Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
    – CalCon
    Nov 7 at 23:05










  • Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
    – CalCon
    Nov 8 at 12:15


















  • I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
    – Ben P.
    Nov 7 at 22:47










  • @Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
    – CalCon
    Nov 7 at 23:05










  • Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
    – CalCon
    Nov 8 at 12:15
















I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
– Ben P.
Nov 7 at 22:47




I'd try deleting your project from Android Studio (close the project until the project chooser dialog shows up, then click the X next to your project) and then re-import it from build.gradle
– Ben P.
Nov 7 at 22:47












@Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
– CalCon
Nov 7 at 23:05




@Ben P. I've tried it, I've also tried deleting .idea folder but it didnt work.
– CalCon
Nov 7 at 23:05












Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
– CalCon
Nov 8 at 12:15




Due to no time to find a fine solution, I've reinstalled Android Studio and it worked. If someone has a more smart fix please post it for the others. Also just for your information, I guess the problem was probably about indexing, Android Studio took one file for another, for example when I opened one image from the drawable, he showed me a different one from the drawable folder, but that's a "fortunate" case, cause he took files from whatever folder. Hope it doesn't happen anymore and it doesn't happen to you guys. Bye.
– CalCon
Nov 8 at 12:15












2 Answers
2






active

oldest

votes

















up vote
0
down vote













The same happened to me when I updated the libraries in gradle kotlin, etc. what I did was to download my project from my version manager and update the libraries one by one and prove the project works.






share|improve this answer





















  • Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
    – CalCon
    Nov 8 at 12:18










  • same thing happened to me. did reinstalling AS finally corrected those errors?
    – Jeongbebs
    Nov 11 at 14:35










  • @Jeongbebs I've posted a quick fix. Hope it helps.
    – CalCon
    Nov 12 at 12:22


















up vote
0
down vote



accepted










So, it happened once again, but I've found a quick fix.
I post it as an answer so people can easily spot it.



Quick fix:




  • Go to the folder "C:Users"your user"


  • Rename the folder ".AndroidStudio3.2" in ".AndroidStudio3.2backup"(name is example)


  • Launch Android Studio, It will not find configuration files, so it will ask you if you want to import them from the folder ".AndroidStudio3.2backup"


  • Click yes, few seconds and now you can delete the backup folder cause it will be created another ".AndroidStudio3.2" folder. Notice that I've renamed the original folder instead of delete it for security, and so to avoid to reconfigure Andoid Studio again, but you can choose to start a new configuration if you want.


  • Once launched Android Studio, click import (gradle...) and import your project.



Everything worked fine after this few seconds quick fix.
Hope it helps.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53199004%2fandroid-studio-strange-behaviour-with-some-files-appearing-different-than-how-th%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    The same happened to me when I updated the libraries in gradle kotlin, etc. what I did was to download my project from my version manager and update the libraries one by one and prove the project works.






    share|improve this answer





















    • Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
      – CalCon
      Nov 8 at 12:18










    • same thing happened to me. did reinstalling AS finally corrected those errors?
      – Jeongbebs
      Nov 11 at 14:35










    • @Jeongbebs I've posted a quick fix. Hope it helps.
      – CalCon
      Nov 12 at 12:22















    up vote
    0
    down vote













    The same happened to me when I updated the libraries in gradle kotlin, etc. what I did was to download my project from my version manager and update the libraries one by one and prove the project works.






    share|improve this answer





















    • Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
      – CalCon
      Nov 8 at 12:18










    • same thing happened to me. did reinstalling AS finally corrected those errors?
      – Jeongbebs
      Nov 11 at 14:35










    • @Jeongbebs I've posted a quick fix. Hope it helps.
      – CalCon
      Nov 12 at 12:22













    up vote
    0
    down vote










    up vote
    0
    down vote









    The same happened to me when I updated the libraries in gradle kotlin, etc. what I did was to download my project from my version manager and update the libraries one by one and prove the project works.






    share|improve this answer












    The same happened to me when I updated the libraries in gradle kotlin, etc. what I did was to download my project from my version manager and update the libraries one by one and prove the project works.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 7 at 23:09









    Juan Carlos Trujillo Almanza

    84




    84












    • Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
      – CalCon
      Nov 8 at 12:18










    • same thing happened to me. did reinstalling AS finally corrected those errors?
      – Jeongbebs
      Nov 11 at 14:35










    • @Jeongbebs I've posted a quick fix. Hope it helps.
      – CalCon
      Nov 12 at 12:22


















    • Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
      – CalCon
      Nov 8 at 12:18










    • same thing happened to me. did reinstalling AS finally corrected those errors?
      – Jeongbebs
      Nov 11 at 14:35










    • @Jeongbebs I've posted a quick fix. Hope it helps.
      – CalCon
      Nov 12 at 12:22
















    Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
    – CalCon
    Nov 8 at 12:18




    Dunno, I've reinstalled Android Studio and reconfigured it. It took me a good amount of time, but in the end it worked. Hope someone read this topic and write a less time-wasting solution. Thanks.
    – CalCon
    Nov 8 at 12:18












    same thing happened to me. did reinstalling AS finally corrected those errors?
    – Jeongbebs
    Nov 11 at 14:35




    same thing happened to me. did reinstalling AS finally corrected those errors?
    – Jeongbebs
    Nov 11 at 14:35












    @Jeongbebs I've posted a quick fix. Hope it helps.
    – CalCon
    Nov 12 at 12:22




    @Jeongbebs I've posted a quick fix. Hope it helps.
    – CalCon
    Nov 12 at 12:22












    up vote
    0
    down vote



    accepted










    So, it happened once again, but I've found a quick fix.
    I post it as an answer so people can easily spot it.



    Quick fix:




    • Go to the folder "C:Users"your user"


    • Rename the folder ".AndroidStudio3.2" in ".AndroidStudio3.2backup"(name is example)


    • Launch Android Studio, It will not find configuration files, so it will ask you if you want to import them from the folder ".AndroidStudio3.2backup"


    • Click yes, few seconds and now you can delete the backup folder cause it will be created another ".AndroidStudio3.2" folder. Notice that I've renamed the original folder instead of delete it for security, and so to avoid to reconfigure Andoid Studio again, but you can choose to start a new configuration if you want.


    • Once launched Android Studio, click import (gradle...) and import your project.



    Everything worked fine after this few seconds quick fix.
    Hope it helps.






    share|improve this answer



























      up vote
      0
      down vote



      accepted










      So, it happened once again, but I've found a quick fix.
      I post it as an answer so people can easily spot it.



      Quick fix:




      • Go to the folder "C:Users"your user"


      • Rename the folder ".AndroidStudio3.2" in ".AndroidStudio3.2backup"(name is example)


      • Launch Android Studio, It will not find configuration files, so it will ask you if you want to import them from the folder ".AndroidStudio3.2backup"


      • Click yes, few seconds and now you can delete the backup folder cause it will be created another ".AndroidStudio3.2" folder. Notice that I've renamed the original folder instead of delete it for security, and so to avoid to reconfigure Andoid Studio again, but you can choose to start a new configuration if you want.


      • Once launched Android Studio, click import (gradle...) and import your project.



      Everything worked fine after this few seconds quick fix.
      Hope it helps.






      share|improve this answer

























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        So, it happened once again, but I've found a quick fix.
        I post it as an answer so people can easily spot it.



        Quick fix:




        • Go to the folder "C:Users"your user"


        • Rename the folder ".AndroidStudio3.2" in ".AndroidStudio3.2backup"(name is example)


        • Launch Android Studio, It will not find configuration files, so it will ask you if you want to import them from the folder ".AndroidStudio3.2backup"


        • Click yes, few seconds and now you can delete the backup folder cause it will be created another ".AndroidStudio3.2" folder. Notice that I've renamed the original folder instead of delete it for security, and so to avoid to reconfigure Andoid Studio again, but you can choose to start a new configuration if you want.


        • Once launched Android Studio, click import (gradle...) and import your project.



        Everything worked fine after this few seconds quick fix.
        Hope it helps.






        share|improve this answer














        So, it happened once again, but I've found a quick fix.
        I post it as an answer so people can easily spot it.



        Quick fix:




        • Go to the folder "C:Users"your user"


        • Rename the folder ".AndroidStudio3.2" in ".AndroidStudio3.2backup"(name is example)


        • Launch Android Studio, It will not find configuration files, so it will ask you if you want to import them from the folder ".AndroidStudio3.2backup"


        • Click yes, few seconds and now you can delete the backup folder cause it will be created another ".AndroidStudio3.2" folder. Notice that I've renamed the original folder instead of delete it for security, and so to avoid to reconfigure Andoid Studio again, but you can choose to start a new configuration if you want.


        • Once launched Android Studio, click import (gradle...) and import your project.



        Everything worked fine after this few seconds quick fix.
        Hope it helps.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 12 at 14:03

























        answered Nov 12 at 12:21









        CalCon

        1117




        1117






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53199004%2fandroid-studio-strange-behaviour-with-some-files-appearing-different-than-how-th%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini