In my android project I tryed to use android.support.v4.widget.DrawerLayout
.
Before it I added it to the libs
library (cp MySdkForder/extras/android/support/v4/android-support-v4.jar MyProjectFolder/libs
)
After that I added it to the classpath
like this:
So I have a code like this in my main.xml
file
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111" />
</android.support.v4.widget.DrawerLayout>
This one I took somewhere on developer.android.com
Idea renders this code totally fine
Problems starts when I'm trying to launch it. When I press run
I have the following error from adb
Cannot reload AVD list: cvc-enumeration-valid: Value '280dpi' is not facet-valid with respect to enumeration '[ldpi, mdpi, tvdpi, hdpi, xhdpi, 400dpi, xxhdpi, 560dpi, xxxhdpi]'. It must be a value from the enumeration.
Error parsing /usr/lib/android/android-sdk-linux/system-images/android-22/android-wear/armeabi-v7a/devices.xml
cvc-enumeration-valid: Value '280dpi' is not facet-valid with respect to enumeration '[ldpi, mdpi, tvdpi, hdpi, xhdpi, 400dpi, xxhdpi, 560dpi, xxxhdpi]'. It must be a value from the enumeration.
Error parsing /usr/lib/android/android-sdk-linux/system-images/android-22/android-wear/x86/devices.xml
cvc-enumeration-valid: Value '280dpi' is not facet-valid with respect to enumeration '[ldpi, mdpi, tvdpi, hdpi, xhdpi, 400dpi, xxhdpi, 560dpi, xxxhdpi]'. It must be a value from the enumeration.
Error parsing /usr/lib/android/android-sdk-linux/system-images/android-22/android-wear/armeabi-v7a/devices.xml
cvc-enumeration-valid: Value '280dpi' is not facet-valid with respect to enumeration '[ldpi, mdpi, tvdpi, hdpi, xhdpi, 400dpi, xxhdpi, 560dpi, xxxhdpi]'. It must be a value from the enumeration.
Error parsing /usr/lib/android/android-sdk-linux/system-images/android-22/android-wear/x86/devices.xm
It looks like this
The funny thing is that I can't even close it (It appears again and again). But that's not my question. The question is how to make this android.support.v4
work? As I think I've done everything what I needed (added this library to libs
and made dependencies) and adb
still doesn't want to work (It works absolutely fine If I don't use android.support.v4
, just standard features)
Use text editor to open Android\android-sdk\system-images\android-22\android-wear\armeabi-v7a\devices.xml Search 280dpi
Change it to hdpi
Do the same for Android\android-sdk\system-images\android-22\android-wear\x86\devices.xml
Close eclipse. Restart eclipse. The error should disappear.
If you are working with windows, the files could be in C:\Program Files (x86)\Android\android-sdk\system-images\android-22\android-wear\armeabi-v7a\devices.xml C:\Program Files (x86)\Android\android-sdk\system-images\android-22\android-wear\x86\devices.xml
I just had this problem go here:
usr/lib/android/android-sdk-linux/system-images/android-22
And remove the android wear folder.
Error Solution:-
Restart Android Studio...and enjoy!!