Android simple ImageView code causing emulator to crash, but works on the device?
<p>I did a lot of online search on this problem and I couldn't find anyone having this problem here. I have run into a strange problem where adding <code>ImageView:src</code> in the xml file is leading my emulator to crash. </p>

<p>I just couldn't understand why this is happening. I have done this before and it worked just fine, but now after five days chasing this problem, I just couldn't understand it.</p>

<p>I have made sure that I have the picture in all the drawable folders (drawable, hdpi, mdpi, ldpi). I also tried jpg, bmps, pngs. It works fine on my physical device, but crashes on the emulator.</p>

<p>main.XML File</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:layout_gravity="center"&gt;

    &lt;ImageView 
    android:id="@+id/image1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"  
    android:src="@drawable/stars1"    
    /&gt;

    &lt;TextView
    android:id="@+id/text1" 
    android:text="Sample Text" 
    android:layout_height="wrap_content" 
    android:gravity="center"
    android:layout_width="wrap_content"
    android:textSize="30dp"
    android:layout_marginLeft="100dp"
    android:layout_marginTop="150dp" /&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>Oncreate() method:</p>

<pre><code>package com.project.testwrappro;
import android.app.Activity;
import android.os.Bundle;

public class TestWrapProActivity extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
</code></pre>
