Devices shown as null
in android preview xml
layout
mode, and no layout
is shown , see attached Screen Shot .. This is not rendering problem, i tried to clean, rebuild, invalidate caches/restart but i did not worked for me , also tried to update support design libraries in gradle based on other answers on stackoverflow but it also not worked for me
Asked
Active
Viewed 658 times
-2

Muhammad Hassaan
- 874
- 6
- 18
-
Try to `Clean` and `Rebuild` your project. – Aditya Jul 24 '18 at 05:08
-
already tried but still getting same error – Muhammad Hassaan Jul 24 '18 at 05:09
-
Then what's the error ? And why you are selected device is showing to `null` ? – Aditya Jul 24 '18 at 05:10
-
can you please set zoom level to 40 % , currently it is 200% – Ganesh Gudghe Jul 24 '18 at 05:10
-
you can see in screen shot , no layout design is shown and devices spinner only show
– Muhammad Hassaan Jul 24 '18 at 05:11 -
You have to select an device to get the preview according to it. – Aditya Jul 24 '18 at 05:13
-
no problem with zoom level dude, – Muhammad Hassaan Jul 24 '18 at 05:13
-
do one thing, on left side of **AppTheme** near to zoom level , there you see an option showing **null**, change it's API Level example to 27 or some other. That will help you – Vishal Thareja Jul 24 '18 at 05:22
-
Check my answer , problem solved with File > Sync Project with Gradle Files – Muhammad Hassaan Jul 24 '18 at 05:23
-
1Possible duplicate of [Android Studio does not show layout preview](https://stackoverflow.com/questions/34499839/android-studio-does-not-show-layout-preview) – InsaneCat Jul 24 '18 at 06:07
2 Answers
6
Android Studio > File > Sync Project with Gradle Files
i am posting answer to my own question because i solved this problem with sync project with gradle files option,All other stuff like clean, rebuild project , invalidate cache/restart did not worked at all Thanks

Muhammad Hassaan
- 874
- 6
- 18
-
Your Problem is solved so please delete this question, because many duplicate question like this in SO. – InsaneCat Jul 24 '18 at 05:29
-
did not found similar questions that is why i posted the question . – Muhammad Hassaan Jul 24 '18 at 06:02
-
what is this : https://stackoverflow.com/questions/34499839/android-studio-does-not-show-layout-preview – InsaneCat Jul 24 '18 at 06:06
-
yes i tried answers from above question but did not worked for me , my question is different , it was not rendering problem , – Muhammad Hassaan Jul 24 '18 at 06:23
-
so no point in giving -1 to my question , as my question was totally different – Muhammad Hassaan Jul 24 '18 at 06:24
-
0
Try the following steps, in order if one does not work try the next one
- Switch to text editor (button at bottom), Check if there are any errors in the layout.
- In the text editor too there is a preview part so you can check if that is working
- Build clean (Preview is not shown if build is not successful)
- Invalidate cache and restart
- Update Android studio

Khemraj Sharma
- 57,232
- 27
- 203
- 212

kalpesh vedak
- 44
- 6