Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using android.support.v4 library in Intellij idea

Tags:

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:

my project settings

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

how idea renders this code

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

Error message

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)

like image 414
PepeHands Avatar asked Oct 21 '15 07:10

PepeHands


People also ask

Can I use Android Studio on IntelliJ?

Are Android Studio projects compatible with IntelliJ IDEA? Yes, the two IDEs use the same project format.

How do I import libraries into IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

Is IntelliJ IDEA good for Android development?

Android Studio may be a better choice for businesses that develop primarily Android Applications. It is worth noting that Android Studio is based on IntelliJ IDEA, so for businesses that develop for multiple platforms, IntelliJ IDEA still offers some support for Android development in addition to other platforms.


1 Answers

I am using Genymotion and I don't need android wear images. I did following:

  1. Uninstalled using SDK manager:

    a) Android 5.1.1 (API 22) -> Android Wear ARM EABI v7a System Image

    b) Android 5.1.1 (API 22) -> Android Wear Intel x86 Atom System Image

  2. Removed all devices using AVD manager and create new one.

Works for me.

like image 199
IgorOK Avatar answered Sep 19 '22 17:09

IgorOK