I am trying to switch over to the new Android Studio (awesome btw) but I can' activate the "Preview" window to view my XML files like they demo'd in I/O.
When I navigate to View-->Tool Windows-->Preview 'Preview' is greyed out and I can't select it.
Does anyone know a fix for this?
Try to 'Invalidate caches & restart'. Restart your Android Studio by choosing this option. It may take some time. Then, if still doesn't work try to rebuild your project.
While in the Android project view, navigate to res/layout/activity_main. xml.
layout error is being caused by a mismatch between Android Studio's cache and your project's current layout. If you suspect this may be the case, then select File > Invalidate Caches / Restart > Invalidate and Restart from Android Studio's toolbar.
Studio 2.2.1 / Build #AI-143.2821654, April 28, 2016.
Regarding: Missing the Preview Tab or grayed out Designer from View/Tool.
From the directory tree, click on the following directory to access activity_main.xml
:
app/src/main/res/layout/activity_main.xml
or (depending on your directory structure, actual location may vary)
app/res/layout/activity_main.xml
Afterward, you should notice the Preview tab to the right.
To access Designer. You'll be able to find the Design|Text tab below your code.
P.S. My problem was the Designer was grayed out. After the fix, the Designer from Menu bar/View/Tool Window/Designer is still grayed out. But you should be able to access the designer anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With