The xml files not recognized by android studio









up vote
1
down vote

favorite












Here is my simple xml and android studio not recognize it and gave no suggestion when I try to write new line. It repeat in any new xml file in this project, but there is no such kind of errors in other my projects



Here is code.... Nothing so special, but if you will check the image, you will see that for example match parent in width property doesnt recogized at all, but put the text in proper way...



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".NewActivity">
<TextView
android:id="@+id/textView"
android:text="Item Detail Here..."
android:textSize="30sp"
android:textColor="#000"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />


enter image description here










share|improve this question























  • plz post completed xml file in text format
    – navylover
    Nov 11 at 7:29














up vote
1
down vote

favorite












Here is my simple xml and android studio not recognize it and gave no suggestion when I try to write new line. It repeat in any new xml file in this project, but there is no such kind of errors in other my projects



Here is code.... Nothing so special, but if you will check the image, you will see that for example match parent in width property doesnt recogized at all, but put the text in proper way...



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".NewActivity">
<TextView
android:id="@+id/textView"
android:text="Item Detail Here..."
android:textSize="30sp"
android:textColor="#000"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />


enter image description here










share|improve this question























  • plz post completed xml file in text format
    – navylover
    Nov 11 at 7:29












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Here is my simple xml and android studio not recognize it and gave no suggestion when I try to write new line. It repeat in any new xml file in this project, but there is no such kind of errors in other my projects



Here is code.... Nothing so special, but if you will check the image, you will see that for example match parent in width property doesnt recogized at all, but put the text in proper way...



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".NewActivity">
<TextView
android:id="@+id/textView"
android:text="Item Detail Here..."
android:textSize="30sp"
android:textColor="#000"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />


enter image description here










share|improve this question















Here is my simple xml and android studio not recognize it and gave no suggestion when I try to write new line. It repeat in any new xml file in this project, but there is no such kind of errors in other my projects



Here is code.... Nothing so special, but if you will check the image, you will see that for example match parent in width property doesnt recogized at all, but put the text in proper way...



<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".NewActivity">
<TextView
android:id="@+id/textView"
android:text="Item Detail Here..."
android:textSize="30sp"
android:textColor="#000"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />


enter image description here







android android-studio






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 7:36









p.alexey

581213




581213










asked Nov 11 at 7:23









Underseamouse

64




64











  • plz post completed xml file in text format
    – navylover
    Nov 11 at 7:29
















  • plz post completed xml file in text format
    – navylover
    Nov 11 at 7:29















plz post completed xml file in text format
– navylover
Nov 11 at 7:29




plz post completed xml file in text format
– navylover
Nov 11 at 7:29












3 Answers
3






active

oldest

votes

















up vote
0
down vote













Firstly check your layout xml file if there are errors.



Then try delete .idea folder of this project, reopen android studio and click Build--Rebuild project menu.






share|improve this answer




















  • already tried... doesnt work. Also tried to Invalidate cache. Nothing
    – Underseamouse
    Nov 11 at 8:00

















up vote
0
down vote













First Check if Your Gradle sync...



After That Be sure if You do not have any error in import R or other packages



after That go to File>Invalidate Caches/Restart



and Build>Clean & Rebuild



It is ok for me :)






share|improve this answer




















  • Already tried everything except R package... How to check it?
    – Underseamouse
    Nov 11 at 8:15










  • You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
    – user7268353
    Nov 11 at 17:17

















up vote
0
down vote













If we could see the whole xml file it will be more helpful, but here are things to try out.



  • if there is more than one view inside that LinearLayout, then set an orientation for the LinearLayout, like so: android:orientation="vertical" or android:orientation="horizontal" for vertical or horizontal orientation.


  • try invalidating the caches and rebuilding the project, File>Invalidate Caches/Restart, then Build> Clean & Rebuild






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%2f53246671%2fthe-xml-files-not-recognized-by-android-studio%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Firstly check your layout xml file if there are errors.



    Then try delete .idea folder of this project, reopen android studio and click Build--Rebuild project menu.






    share|improve this answer




















    • already tried... doesnt work. Also tried to Invalidate cache. Nothing
      – Underseamouse
      Nov 11 at 8:00














    up vote
    0
    down vote













    Firstly check your layout xml file if there are errors.



    Then try delete .idea folder of this project, reopen android studio and click Build--Rebuild project menu.






    share|improve this answer




















    • already tried... doesnt work. Also tried to Invalidate cache. Nothing
      – Underseamouse
      Nov 11 at 8:00












    up vote
    0
    down vote










    up vote
    0
    down vote









    Firstly check your layout xml file if there are errors.



    Then try delete .idea folder of this project, reopen android studio and click Build--Rebuild project menu.






    share|improve this answer












    Firstly check your layout xml file if there are errors.



    Then try delete .idea folder of this project, reopen android studio and click Build--Rebuild project menu.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 11 at 7:42









    navylover

    2,89621117




    2,89621117











    • already tried... doesnt work. Also tried to Invalidate cache. Nothing
      – Underseamouse
      Nov 11 at 8:00
















    • already tried... doesnt work. Also tried to Invalidate cache. Nothing
      – Underseamouse
      Nov 11 at 8:00















    already tried... doesnt work. Also tried to Invalidate cache. Nothing
    – Underseamouse
    Nov 11 at 8:00




    already tried... doesnt work. Also tried to Invalidate cache. Nothing
    – Underseamouse
    Nov 11 at 8:00












    up vote
    0
    down vote













    First Check if Your Gradle sync...



    After That Be sure if You do not have any error in import R or other packages



    after That go to File>Invalidate Caches/Restart



    and Build>Clean & Rebuild



    It is ok for me :)






    share|improve this answer




















    • Already tried everything except R package... How to check it?
      – Underseamouse
      Nov 11 at 8:15










    • You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
      – user7268353
      Nov 11 at 17:17














    up vote
    0
    down vote













    First Check if Your Gradle sync...



    After That Be sure if You do not have any error in import R or other packages



    after That go to File>Invalidate Caches/Restart



    and Build>Clean & Rebuild



    It is ok for me :)






    share|improve this answer




















    • Already tried everything except R package... How to check it?
      – Underseamouse
      Nov 11 at 8:15










    • You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
      – user7268353
      Nov 11 at 17:17












    up vote
    0
    down vote










    up vote
    0
    down vote









    First Check if Your Gradle sync...



    After That Be sure if You do not have any error in import R or other packages



    after That go to File>Invalidate Caches/Restart



    and Build>Clean & Rebuild



    It is ok for me :)






    share|improve this answer












    First Check if Your Gradle sync...



    After That Be sure if You do not have any error in import R or other packages



    after That go to File>Invalidate Caches/Restart



    and Build>Clean & Rebuild



    It is ok for me :)







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 11 at 7:58







    user7268353


















    • Already tried everything except R package... How to check it?
      – Underseamouse
      Nov 11 at 8:15










    • You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
      – user7268353
      Nov 11 at 17:17
















    • Already tried everything except R package... How to check it?
      – Underseamouse
      Nov 11 at 8:15










    • You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
      – user7268353
      Nov 11 at 17:17















    Already tried everything except R package... How to check it?
    – Underseamouse
    Nov 11 at 8:15




    Already tried everything except R package... How to check it?
    – Underseamouse
    Nov 11 at 8:15












    You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
    – user7268353
    Nov 11 at 17:17




    You should Import it in activity for this layout ... Your package name.R like it ... Remove it after that click On R and Insert Alt+Enter and choose Import
    – user7268353
    Nov 11 at 17:17










    up vote
    0
    down vote













    If we could see the whole xml file it will be more helpful, but here are things to try out.



    • if there is more than one view inside that LinearLayout, then set an orientation for the LinearLayout, like so: android:orientation="vertical" or android:orientation="horizontal" for vertical or horizontal orientation.


    • try invalidating the caches and rebuilding the project, File>Invalidate Caches/Restart, then Build> Clean & Rebuild






    share|improve this answer
























      up vote
      0
      down vote













      If we could see the whole xml file it will be more helpful, but here are things to try out.



      • if there is more than one view inside that LinearLayout, then set an orientation for the LinearLayout, like so: android:orientation="vertical" or android:orientation="horizontal" for vertical or horizontal orientation.


      • try invalidating the caches and rebuilding the project, File>Invalidate Caches/Restart, then Build> Clean & Rebuild






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        If we could see the whole xml file it will be more helpful, but here are things to try out.



        • if there is more than one view inside that LinearLayout, then set an orientation for the LinearLayout, like so: android:orientation="vertical" or android:orientation="horizontal" for vertical or horizontal orientation.


        • try invalidating the caches and rebuilding the project, File>Invalidate Caches/Restart, then Build> Clean & Rebuild






        share|improve this answer












        If we could see the whole xml file it will be more helpful, but here are things to try out.



        • if there is more than one view inside that LinearLayout, then set an orientation for the LinearLayout, like so: android:orientation="vertical" or android:orientation="horizontal" for vertical or horizontal orientation.


        • try invalidating the caches and rebuilding the project, File>Invalidate Caches/Restart, then Build> Clean & Rebuild







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 11 at 8:22









        Ebi Igweze

        22927




        22927



























            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%2f53246671%2fthe-xml-files-not-recognized-by-android-studio%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







            Popular posts from this blog

            Top Tejano songwriter Luis Silva dead of heart attack at 64

            ReactJS Fetched API data displays live - need Data displayed static

            Evgeni Malkin