18
votes

I ported an android project from Eclipse to Android Studio. The project builds just fine. However I am not able to see any layout preview. When I go to the Design tab of a layout I get a

Loading Configuration...

message that never goes away (see image).

enter image description here
I have set correctly the Android SDK in the project structure. This happens with all the xml files and I am not able to open the "Preview" window from

View -> Tool Windows -> Preview

I tried creating a new project and everything was showing fine. Am I missing something? Anyone faced a similar issue? Is there a chance that this is happening because the folder structure is not the default one? (The layouts are not under project/src/main/res/layout but under project/res/layout)

9
I have the same problem and in my case the layouts are in the default folder.Ilya Kogan
I had to mess around with the project..and at some point it worked. I don't know how though. My guess would be that creating a new project and adding your source code would work every time. Sorry for not being very clear, but honestly I was surprized even myself that it worked.Thomas Kaliakos

9 Answers

9
votes

Try this

  1. Build> Clean Project
  2. Build> Rebuild Project

It worked for me

4
votes

Just do a right click on the layout preview and click on

Show Included in contentmain.xml

you can see it in the following image enter image description here

3
votes

I had the same problem and I solved as follow

  1. Update all build.gradle files with:

classpath 'com.android.tools.build:gradle:0.5.+'

Now android studio 0.2.+ uses gradle 0.5

  1. Closes de IDE and via Terminal/Console
  2. Do a clean: $gradle clean
  3. Do a build: $gradle build
  4. Assemble it: $gradle assembleDebug
  5. Open the Android Studio and be happy ;)
1
votes

Close android studio and go to path as follow: C:\Users\user\ .AndroidStudio1.2\restart There is a file named restarter,double click on it and open android studio again,create a new project and enjoy it

0
votes

Maybe it is better to use the 0.3.6 version (latest), with this version of gradle : com.android.tools.build:gradle:0.6.+

Bear in mind that Android Studio will be expecting the Android SDK already installed (as I suppose you have), and also the environment variables ANDROID_HOME and GRADLE_HOME.

0
votes

Try updating your API to the latest version in the SDK manager ---- worked for me

0
votes

I had the same problem Follow this step :

Done

0
votes

In Android Studio

File>Invalidate Caches/Restart

that's how i fixed

0
votes

You can try :

  1. Select Preview window(Focus on it)
  2. Unselect Floating mode and Pinned mode
  3. goto Window -> Active Tool Window ->
  4. Unselect Floating mode and Pinned mode
  5. Now you can see Docked window option here(Window -> Active Tool Window ->)
  6. Select Docked Window