Android Studio 3.2 layout "preview" not emulating material design components properly - android

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:
But here's a screenshot of how it looks in the Android studio's Preview.
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

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.

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.

Sorry, I'm here 3 years late... But this was my solution for this render problem... It has Material.Light theme by default. If you change it to Light.Bridge the problem is solved!
Hope it helps some one

Related

How to install the Bumblebee 2021.1.1 Android Studio Patch?

When I open Android Studio I receive a notification saying that an update is available:
The latest stable release of Android Studio is now available for download.
Android Studio Bumblebee | 2021.1.1 Patch 1 is a major new release and includes performance improvements, bug fixes and new features.
- Intellij 2021.1.1 Platform Update
- New Device Manager
- ADB over Wi-Fi
- Run Instrumented Tests in Android Studio using Gradle
- Android Gradle Plugin Upgrade Assistant now updates API usage
- Non-Transitive R classes on for new projects
- Apple Silicon Support Update
- Jank detection track in Profilers
- Profileable app profiling support in Studio Profilers
- Network Inspection and ability to capture Layout Inspector snapshots
- Support for Compose semantics in the Layout Inspector
- Interactive Preview
- Animated Vector Drawables Preview
- Updated Device picker for Design Tools
Important After updating, you need to restart Android Studio to apply any memory settings you migrate from an earlier version of the IDE.
Release Notes
However when I click on the Download button it opens a web page to re-download the whole program instead of updating it. It's a bit confusing because it's a minor update.
This issue was fixed by Google (10 February 2022).
You can now update Android Studio normally.
Thank you all for helping to bring this problem to Google's attention.
The problem was fixed.
You can now update through the IDE without any webpage redirects or workarounds.
https://issuetracker.google.com/issues/217880228
Download and install JetBrains Toolbox. Android studio patch update will show in the toolbox list. Update through this. Hope its helpful.
As written in the issuetracker (217880288):
Workaround: delete manually only the "C:\Program Files\Android\Android Studio"-folder and then install AS again. All your preferences will be restored because they are saved in your profile folder.
This worked for me.
However I for my part only renamed the old Android Studio folder and will keep it for a few Versions just to be have it in case of problems - but I didn't notice any problems yet.
P.S.: I readded the folder as exclusion from Antivirus, even if I do not remember well if this is still helping performance.
P.P.S.: Before I also tried the JetBrains Toolbox way to update AS, it said it installed the patch - however I still got the messages afterwards and it was still using old gradle.

Android Studio freezes after updating to 2.0

I have just updated my Android Studio from 1.4 to 2.0, on startup it freezes on splash-screen. is it possible to fix it or i have to download it again?
Its very strange. I have also updated to 2.0 in my MAC, Ubuntu and Windows 10. I didn't feel any issues till now in any of these.
Please note that 2.0 is still a preview. You may have to wait till Google releases the stable version.
Which operating system are you using?
For Windows, check the log of
C:\Users\<Username>\.AndroidStudioPreview2.0\system\log\idea.log
and paste here the last relevant entries on the bottom with a recent timestamp, containing an error message or indication of a possible freeze.
Also, check that you don't have any Android Studio, IntelliJ, or java-processes running before you start Android Studio.
This is an answer for my question, after trying many methods now it works fine.
This is how i resolved my problem by:
Updating Android SDK Tools and the latest SDK Platform
Removing the Android Studio cache folder situated in
C:\Users\<username>\.AndroidStudioPreview2.0
Running android studio again
At First Update Your Android SDK Tools (Support Repository )
Actually Android Studio creates a local directory . AndroidStudio to
cache its own data. In most environments, this is acceptable. However,
the size of the directory can easily exceed 300Mb and, if you have a
space constraint on your home drive (or a roaming profile in windows),
this may be better off in some other place.
The location of this directory is placed in an idea.properties file in the bin/ directory of your AS is installed.

Missing Design Tab in Android Studio

The Design Tab in Android Studio has disappeared after I download the latest version of SDK.
Below is the screen:
enter image description here
I have tried the methods suggested in the posts similar to my issue, which is stated as follows:
Try Designer button in the right (I do not have this button)
Try View -> Tools Window -> Designer (This button is greyed)
I saw someone suggested that this is due to the SDK location is not set correctly, nevertheless, I am not sure how I should re-set the SDK location or even check whether the SDK location is wrong.
If you update Android SDK so mostly you only need to switch to a lower API:
https://www.dropbox.com/s/6ju3br0jlccqacd/api.png?dl=0
The Android SDK is a problem that bothers designer render.
But if it does not correct this error so it is usually a mistake android studios. Android Studio is a program with a lot of errors.
Sorry I´m using google translate.
Edit:
Or go to android SDK manager and download the android tools and android reposity and android assets.
If you have upgraded your android studio and you are viewing your old projects after this, you will not be able to see the design tab. So, create a new project and just import all the old java codes into new one.

Rendering Problems Android Studio 0.8.2

I updated Android Studio to 0.8.2 and at first I had Gradle problems and Rendering Problems.
My Rendering Problem was that I didn't select a render target. After fixing this problem I got another Rendering problem.
Rendering Problems File C:\Users\User\AppData\Local\Android\android-studio2\sdk\platforms\android-19\data\layoutlib.jar doesnt exist (Details).
I've searched so much on the internet and I even downloaded the layoutlib.jar file but it didn't solve my problem. I really need help because I wanna concentrate on my work.
THANK YOU IN ADVANCE
Had the same problem. What worked for me is deleting the SDK Platform for the specific API (19 in this case) using Android SDK manager. If you open SDK manager and expand the different Platforms packages like Android 5.0.1(API 21) and so on, you'll see the respective SDK Platform underneath. Select the one you're having trouble with and delete it. Then reinstall it.
Try to update SDK.
Tools -> Android -> SDK Manager, when the manager is opened packages which have updates will be checked, you just click "Install packages".
Delete all items in andoid 21 and install again. Your problem will be solved. Thanks..
Just uninstall and reinstall
specific android APK
with android here it android-19
Tools -> Android -> SDK Manager
1.uncheck the specific android APK android check box the apply (wait if need to unistall)
recheck the same specific android APK android apk and then click on Apply

Eclipse wont recognize Android support library revision 9

I recently downloaded all the latest updates for my eclipse/Android plugins (before the upgrades everything worked fine). I got everything to work except when i try to create a new project I get a message that I need Android support library revision 8. I click Install/Upgrade and It proceeds to download and install the library. When it finishes the tiny download/install window disappears but the window which informs me that i need Android support library revision 8 remains open and i cant click finish to create new project. I tried closing the window and eclipse and trying it again but it always leads me to the window which states I need the Android support library revision 8. I didnt move eclipse to any other location and I am wondering what is wrong.
I had a problem before with an ! in my eclipse path and eclipse wouldnt work because of exit error 13. I posted a question about it before. My answer explains what has happened and the easy fix.
I am wondering what is wrong now. Do i need to manually link the support library?
Im really frustrated because its taking me forever to set this up.
Update:
I tried restarting eclipse and reinstalling the library multiple times.
I upgraded the android sdk tools and sdk platform-tools before i installed the support libraries.
Like these similar issue i'd for 2 days ago. Whenever, i'm trying to create a new project its showing me like below
For, this i've downloaded that support library using Install/Upgrade and in my path E:/Android/Android-Sdk/extras/android/compaitability I've changed the name of compaitability as support and after just restarted my Eclipse. Its working fine.
Hope these helps you.
Try updating android sdk tools and sdk platform-tools and restart eclipse? ADT has dependencies on these.

Categories

Resources