Android Studio 3.2 layout “preview” not emulating material design components properly












0















I've been updating my project to target sdk-api28 and I started setting up the latest MaterialComponents, but I'm now having issues with the layout Previewer within Android Studio.



The Preview just won't display the correct design for the material components, eg. adding style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" on a TextInputLayout view won't change the design (no outlines) in the emulated preview, but it does look okay when running on a phone (got outlines).



Here's how it should and does look when running on phones:
enter image description here



But here's a screenshot of how it looks in the Android studio's Preview.
enter image description here



I'm having this issue on any project, and even on the Shrine tutorial app with the same setup from MDC Codelabs (MDC-103(Java) - Shrine).



This happens only on the preview. Any of these projects, when running on a phone or on the emulator within Studio, look okay.



As much as I could 'think through' this, the issue is I believe somehow connected to my Android Studio, emulator, or maybe build tools versions? Please, could someone point out if I'm missing something very simple?



My Android Studio (sdk, tools etc) versions that I have installed:




  • Android Studio 3.2.1

  • Android Emulator 28.0.16

  • Android Platform Version: API 28: Android 9 (Pie) revision 6

  • Android SDK Platform-Tools 28.0.1

  • Android SDK Tools 26.1.1










share|improve this question





























    0















    I've been updating my project to target sdk-api28 and I started setting up the latest MaterialComponents, but I'm now having issues with the layout Previewer within Android Studio.



    The Preview just won't display the correct design for the material components, eg. adding style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" on a TextInputLayout view won't change the design (no outlines) in the emulated preview, but it does look okay when running on a phone (got outlines).



    Here's how it should and does look when running on phones:
    enter image description here



    But here's a screenshot of how it looks in the Android studio's Preview.
    enter image description here



    I'm having this issue on any project, and even on the Shrine tutorial app with the same setup from MDC Codelabs (MDC-103(Java) - Shrine).



    This happens only on the preview. Any of these projects, when running on a phone or on the emulator within Studio, look okay.



    As much as I could 'think through' this, the issue is I believe somehow connected to my Android Studio, emulator, or maybe build tools versions? Please, could someone point out if I'm missing something very simple?



    My Android Studio (sdk, tools etc) versions that I have installed:




    • Android Studio 3.2.1

    • Android Emulator 28.0.16

    • Android Platform Version: API 28: Android 9 (Pie) revision 6

    • Android SDK Platform-Tools 28.0.1

    • Android SDK Tools 26.1.1










    share|improve this question



























      0












      0








      0








      I've been updating my project to target sdk-api28 and I started setting up the latest MaterialComponents, but I'm now having issues with the layout Previewer within Android Studio.



      The Preview just won't display the correct design for the material components, eg. adding style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" on a TextInputLayout view won't change the design (no outlines) in the emulated preview, but it does look okay when running on a phone (got outlines).



      Here's how it should and does look when running on phones:
      enter image description here



      But here's a screenshot of how it looks in the Android studio's Preview.
      enter image description here



      I'm having this issue on any project, and even on the Shrine tutorial app with the same setup from MDC Codelabs (MDC-103(Java) - Shrine).



      This happens only on the preview. Any of these projects, when running on a phone or on the emulator within Studio, look okay.



      As much as I could 'think through' this, the issue is I believe somehow connected to my Android Studio, emulator, or maybe build tools versions? Please, could someone point out if I'm missing something very simple?



      My Android Studio (sdk, tools etc) versions that I have installed:




      • Android Studio 3.2.1

      • Android Emulator 28.0.16

      • Android Platform Version: API 28: Android 9 (Pie) revision 6

      • Android SDK Platform-Tools 28.0.1

      • Android SDK Tools 26.1.1










      share|improve this question
















      I've been updating my project to target sdk-api28 and I started setting up the latest MaterialComponents, but I'm now having issues with the layout Previewer within Android Studio.



      The Preview just won't display the correct design for the material components, eg. adding style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" on a TextInputLayout view won't change the design (no outlines) in the emulated preview, but it does look okay when running on a phone (got outlines).



      Here's how it should and does look when running on phones:
      enter image description here



      But here's a screenshot of how it looks in the Android studio's Preview.
      enter image description here



      I'm having this issue on any project, and even on the Shrine tutorial app with the same setup from MDC Codelabs (MDC-103(Java) - Shrine).



      This happens only on the preview. Any of these projects, when running on a phone or on the emulator within Studio, look okay.



      As much as I could 'think through' this, the issue is I believe somehow connected to my Android Studio, emulator, or maybe build tools versions? Please, could someone point out if I'm missing something very simple?



      My Android Studio (sdk, tools etc) versions that I have installed:




      • Android Studio 3.2.1

      • Android Emulator 28.0.16

      • Android Platform Version: API 28: Android 9 (Pie) revision 6

      • Android SDK Platform-Tools 28.0.1

      • Android SDK Tools 26.1.1







      android android-studio android-layout material-design






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 23:36







      demi

















      asked Nov 15 '18 at 23:20









      demidemi

      9719




      9719
























          2 Answers
          2






          active

          oldest

          votes


















          0














          This issue happaned to me in android studio 3.2.
          after one day everything gose fine.

          what i do was invalidate and restart. reset android studio default settings
          the clean. and exit android studio and open it again. and it works fine
          this is a bug not related to you only.






          share|improve this answer
























          • Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

            – demi
            Nov 16 '18 at 9:26



















          0














          While some users who experienced similar issues, could solve this with cleaning out Android Studio cache and config, this didn't work for me.



          After looking into various possible fixes and tips, I solved this by updating to Android Studio 3.4 Canary which is the latest non-guaranteed-stable version of Android Studio, which you can get by either downloading a Preview release (here: developer.android.com) or changing your update preference (within Android Studio) ie. Update channel to Dev channel or Canary channel within Android Studio Settings > Appearance & Behaviour > System settings > Updates



          I do think that this might not be a proper fix, but it's the only thing that worked out for me and solved the layout (design) preview not being able to display correct design.



          If someone else runs into a similar issue, make sure to first try out clearing cache, using the Invalidate and restart under File menu or any other method. The Invalidate and restart feature clears out cache and restarts android studio, after which it will have to sync again and check for all dependencies, Sdk, tools etc.



          Also to avoid this issue, before trying out anything else make sure you have proper and latest SDK Build-tools, Emulator, SDK Platform-tools, SDK Tools versions installed.



          I'll leave this here as an answer for now, and update it if any new solutions come around.






          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',
            autoActivateHeartbeat: false,
            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%2f53329237%2fandroid-studio-3-2-layout-preview-not-emulating-material-design-components-pro%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









            0














            This issue happaned to me in android studio 3.2.
            after one day everything gose fine.

            what i do was invalidate and restart. reset android studio default settings
            the clean. and exit android studio and open it again. and it works fine
            this is a bug not related to you only.






            share|improve this answer
























            • Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

              – demi
              Nov 16 '18 at 9:26
















            0














            This issue happaned to me in android studio 3.2.
            after one day everything gose fine.

            what i do was invalidate and restart. reset android studio default settings
            the clean. and exit android studio and open it again. and it works fine
            this is a bug not related to you only.






            share|improve this answer
























            • Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

              – demi
              Nov 16 '18 at 9:26














            0












            0








            0







            This issue happaned to me in android studio 3.2.
            after one day everything gose fine.

            what i do was invalidate and restart. reset android studio default settings
            the clean. and exit android studio and open it again. and it works fine
            this is a bug not related to you only.






            share|improve this answer













            This issue happaned to me in android studio 3.2.
            after one day everything gose fine.

            what i do was invalidate and restart. reset android studio default settings
            the clean. and exit android studio and open it again. and it works fine
            this is a bug not related to you only.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 15 '18 at 23:42









            Ramzy HassanRamzy Hassan

            369315




            369315













            • Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

              – demi
              Nov 16 '18 at 9:26



















            • Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

              – demi
              Nov 16 '18 at 9:26

















            Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

            – demi
            Nov 16 '18 at 9:26





            Hey Ramzy, this didn't solve the issue, but thanks for the tip. I did try the Invalidate (caches) and restart option under File but unfortunately this didn't change anything.

            – demi
            Nov 16 '18 at 9:26













            0














            While some users who experienced similar issues, could solve this with cleaning out Android Studio cache and config, this didn't work for me.



            After looking into various possible fixes and tips, I solved this by updating to Android Studio 3.4 Canary which is the latest non-guaranteed-stable version of Android Studio, which you can get by either downloading a Preview release (here: developer.android.com) or changing your update preference (within Android Studio) ie. Update channel to Dev channel or Canary channel within Android Studio Settings > Appearance & Behaviour > System settings > Updates



            I do think that this might not be a proper fix, but it's the only thing that worked out for me and solved the layout (design) preview not being able to display correct design.



            If someone else runs into a similar issue, make sure to first try out clearing cache, using the Invalidate and restart under File menu or any other method. The Invalidate and restart feature clears out cache and restarts android studio, after which it will have to sync again and check for all dependencies, Sdk, tools etc.



            Also to avoid this issue, before trying out anything else make sure you have proper and latest SDK Build-tools, Emulator, SDK Platform-tools, SDK Tools versions installed.



            I'll leave this here as an answer for now, and update it if any new solutions come around.






            share|improve this answer




























              0














              While some users who experienced similar issues, could solve this with cleaning out Android Studio cache and config, this didn't work for me.



              After looking into various possible fixes and tips, I solved this by updating to Android Studio 3.4 Canary which is the latest non-guaranteed-stable version of Android Studio, which you can get by either downloading a Preview release (here: developer.android.com) or changing your update preference (within Android Studio) ie. Update channel to Dev channel or Canary channel within Android Studio Settings > Appearance & Behaviour > System settings > Updates



              I do think that this might not be a proper fix, but it's the only thing that worked out for me and solved the layout (design) preview not being able to display correct design.



              If someone else runs into a similar issue, make sure to first try out clearing cache, using the Invalidate and restart under File menu or any other method. The Invalidate and restart feature clears out cache and restarts android studio, after which it will have to sync again and check for all dependencies, Sdk, tools etc.



              Also to avoid this issue, before trying out anything else make sure you have proper and latest SDK Build-tools, Emulator, SDK Platform-tools, SDK Tools versions installed.



              I'll leave this here as an answer for now, and update it if any new solutions come around.






              share|improve this answer


























                0












                0








                0







                While some users who experienced similar issues, could solve this with cleaning out Android Studio cache and config, this didn't work for me.



                After looking into various possible fixes and tips, I solved this by updating to Android Studio 3.4 Canary which is the latest non-guaranteed-stable version of Android Studio, which you can get by either downloading a Preview release (here: developer.android.com) or changing your update preference (within Android Studio) ie. Update channel to Dev channel or Canary channel within Android Studio Settings > Appearance & Behaviour > System settings > Updates



                I do think that this might not be a proper fix, but it's the only thing that worked out for me and solved the layout (design) preview not being able to display correct design.



                If someone else runs into a similar issue, make sure to first try out clearing cache, using the Invalidate and restart under File menu or any other method. The Invalidate and restart feature clears out cache and restarts android studio, after which it will have to sync again and check for all dependencies, Sdk, tools etc.



                Also to avoid this issue, before trying out anything else make sure you have proper and latest SDK Build-tools, Emulator, SDK Platform-tools, SDK Tools versions installed.



                I'll leave this here as an answer for now, and update it if any new solutions come around.






                share|improve this answer













                While some users who experienced similar issues, could solve this with cleaning out Android Studio cache and config, this didn't work for me.



                After looking into various possible fixes and tips, I solved this by updating to Android Studio 3.4 Canary which is the latest non-guaranteed-stable version of Android Studio, which you can get by either downloading a Preview release (here: developer.android.com) or changing your update preference (within Android Studio) ie. Update channel to Dev channel or Canary channel within Android Studio Settings > Appearance & Behaviour > System settings > Updates



                I do think that this might not be a proper fix, but it's the only thing that worked out for me and solved the layout (design) preview not being able to display correct design.



                If someone else runs into a similar issue, make sure to first try out clearing cache, using the Invalidate and restart under File menu or any other method. The Invalidate and restart feature clears out cache and restarts android studio, after which it will have to sync again and check for all dependencies, Sdk, tools etc.



                Also to avoid this issue, before trying out anything else make sure you have proper and latest SDK Build-tools, Emulator, SDK Platform-tools, SDK Tools versions installed.



                I'll leave this here as an answer for now, and update it if any new solutions come around.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 16 '18 at 9:48









                demidemi

                9719




                9719






























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53329237%2fandroid-studio-3-2-layout-preview-not-emulating-material-design-components-pro%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

                    Xamarin.iOS Cant Deploy on Iphone

                    Glorious Revolution

                    Dulmage-Mendelsohn matrix decomposition in Python