18

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)

Thomas Kaliakos
  • 3,274
  • 4
  • 25
  • 39
  • I have the same problem and in my case the layouts are in the default folder. – Ilya Kogan Jul 10 '13 at 06:31
  • 1
    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 Oct 15 '13 at 04:08
  • Possible Duplicate: [endless-loading-configuration-in-design-view](http://stackoverflow.com/questions/17596295/endless-loading-configuration-in-design-view/30745990#30745990) – damn_c Jun 10 '15 at 03:16

9 Answers9

9

Try this

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

It worked for me

kishan
  • 91
  • 1
  • 2
4

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

Elham Kohestani
  • 3,013
  • 3
  • 20
  • 29
3

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 ;)
Fernando Martínez
  • 1,057
  • 10
  • 13
1

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

Badzalk
  • 11
  • 3
0

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.

facundofarias
  • 2,973
  • 28
  • 27
0

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

ENDEESA
  • 3,373
  • 2
  • 21
  • 17
0

I had the same problem Follow this step :

Done

Dhaval Jivani
  • 9,467
  • 2
  • 48
  • 42
0

In Android Studio

File>Invalidate Caches/Restart

that's how i fixed

0

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
Sachith Muhandiram
  • 2,819
  • 10
  • 45
  • 94