I am trying to build an app in AOSP, my development kit has HDPI density, I have double verified it with the following code snippet:

```
switch (getResources().getDisplayMetrics().densityDpi) {
case DisplayMetrics.DENSITY_LOW:
    Log.d(TAG, "\n\n\n\n LDPI \n\n\n\n");
    break;
case DisplayMetrics.DENSITY_MEDIUM:
    Log.d(TAG, "\n\n\n\n MDPI \n\n\n\n");
    break;
case DisplayMetrics.DENSITY_HIGH:
    Log.d(TAG, "\n\n\n\n HDPI \n\n\n\n");
    // ...
    break;
case DisplayMetrics.DENSITY_XHIGH:
    Log.d(TAG, "\n\n\n\n XDPI \n\n\n\n");
    // ...
    break;
}

```

when I build my application in Android File system,and if I run it, then I am getting following error:

```
E/AndroidRuntime(  825): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class android.widget.Button
E/AndroidRuntime(  825):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
E/AndroidRuntime(  825):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(  825):        at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(  825):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(  825):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  825):        at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(  825):        at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(  825):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  825):        at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(  825):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(  825):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(  825):        at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(  825): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class android.widget.Button
E/AndroidRuntime(  825):        at android.view.LayoutInflater.createView(LayoutInflater.java:606)
E/AndroidRuntime(  825):        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:823)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:729)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/AndroidRuntime(  825):        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
E/AndroidRuntime(  825):        at android.app.Activity.setContentView(Activity.java:1835)
E/AndroidRuntime(  825):        at com.example.MainActivity.onCreate(MainActivity.java:96)
E/AndroidRuntime(  825):        at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(  825):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(  825):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(  825):        ... 11 more
E/AndroidRuntime(  825): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(  825):        at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(  825):        at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(  825):        at android.view.LayoutInflater.createView(LayoutInflater.java:586)
E/AndroidRuntime(  825):        ... 29 more
E/AndroidRuntime(  825): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f02000d a=-1 r=0x7f02000d}
E/AndroidRuntime(  825):        at android.content.res.Resources.loadDrawable(Resources.java:1897)
E/AndroidRuntime(  825):        at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime(  825):        at android.widget.TextView.<init>(TextView.java:620)
E/AndroidRuntime(  825):        at android.widget.Button.<init>(Button.java:108)
E/AndroidRuntime(  825):        at android.widget.Button.<init>(Button.java:104)
E/AndroidRuntime(  825):        ... 32 more

```

My all the drawable resources are in drawable-hdpi.

But if I put drawables in all the drawable-\* folder then app runs.
But then UI is getting scattered.

Does anybody have idea, what the problem could. Do I have to add any Variable or flag in the Android.mk

```
=========edit=========
The app works fine if I build with eclipse. And run on the same device.
Therefore issue might be in building app along with AOSP.
========================

```

Any help would be highly appreciated.

Regards,
Yuvi