使用IntelliJ IDEA的android.support.v4库 [英] using android.support.v4 library in Intellij idea

查看:2025
本文介绍了使用IntelliJ IDEA的android.support.v4库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid项目我trye​​d使用 android.support.v4.widget.DrawerLayout

In my android project I tryed to use android.support.v4.widget.DrawerLayout.

在它,我把它添加到库( CP MySdkForder /演员/安卓/支持/ V4 / Android的支持,v4.jar myProjectFolder的/库

Before it I added it to the libs library (cp MySdkForder/extras/android/support/v4/android-support-v4.jar MyProjectFolder/libs)

之后,我将其添加到的classpath 是这样的:

After that I added it to the classpath like this:

所以我有这样的code在我的的main.xml 文件

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>

这一个我承担了 developer.android.com

理念呈现此code完全好

Idea renders this code totally fine

当我试图启动它的问题开始。当我preSS 运行我有以下错误亚洲开发银行

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

有趣的是,我甚至不能关闭它(这似乎一次又一次地)。但是,这不是我的问题。现在的问题是如何使这个 android.support.v4 工作?因为我觉得我所做的一切,我需要的东西(加这个库,并提出相关性)和亚洲开发银行仍不想上班(它的工作原理完全正常,如果我不使用 android.support.v4 ,只是标准功能)

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)

推荐答案

我使用Genymotion,我也不需要机器人的磨损图像。我下面的:

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

  1. 使用SDK管理器卸载:

  1. Uninstalled using SDK manager:

A)的Andr​​oid 5.1.1(API 22) - > Android的磨损ARM EABI V7A系统映像

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

B)的Andr​​oid 5.1.1(API 22) - > Android的磨损英特尔凌动x86的系统映像

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

删除使用AVD管理所有设备,并创建新的。

Removed all devices using AVD manager and create new one.

我的作品。

这篇关于使用IntelliJ IDEA的android.support.v4库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆