已安装EclipseAndroid SDK包(最新版本:API级别20),可以';不要运行以前运行的程序

已安装EclipseAndroid SDK包(最新版本:API级别20),可以';不要运行以前运行的程序,android,xml,eclipse,adt,android-support-library,Android,Xml,Eclipse,Adt,Android Support Library,一个多月前,我用ADT 22.06.2下载了EclipseIndigo。我有几个项目,它们编译并生成的应用程序显然是在Bluestack上运行的 今天,我下载了带有ADT 23.02.1259578的EclipseJuno 我导入了一个使用EclipseIndigo的项目。其样式表生成以下错误: 错误:检索项的父项时出错:未找到与给定名称“Theme.AppCompat.Light”匹配的资源 及 错误:检索项的父项时出错:未找到与给定名称“Theme.AppCompat.Light.DarkA

一个多月前,我用ADT 22.06.2下载了EclipseIndigo。我有几个项目,它们编译并生成的应用程序显然是在Bluestack上运行的

今天,我下载了带有ADT 23.02.1259578的EclipseJuno

我导入了一个使用EclipseIndigo的项目。其样式表生成以下错误:

错误:检索项的父项时出错:未找到与给定名称“Theme.AppCompat.Light”匹配的资源

错误:检索项的父项时出错:未找到与给定名称“Theme.AppCompat.Light.DarkActionBar”匹配的资源

它们出现在以下三个样式表中(它们是谷歌为Android应用程序开发人员提供的“Hello World”类型示例中的原始样式表):


显然,导入“android-support-v7-appcompat”[新Eclipse软件包附带的版本]没有帮助

导入项目时,会出现两个(而不是三个)相同的错误。它们是:

[2014-07-27 18:27:00-HOGLES200043]无法解析目标“android-19” [2014-07-27 18:27:00-HOGLES200043]无法解析目标“android-19”

此项目的清单如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.opengl0043"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<uses-feature
    android:glEsVersion="0x00020000" android:required="true" />


<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.android.opengl0043.OpenGLES20Activity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

这里有我遗漏的东西吗


感谢您的帮助。

显然,当库有资源时,仅仅导入库是不够的。我按照以下步骤创建了一个T(在谷歌的Android应用程序开发者网站上可以找到),我可以编译这个项目,应用程序也可以像以前一样运行:

=================================================================================

使用资源添加库

要向应用程序项目中添加包含资源(如操作栏的v7 appcompat)的支持库,请执行以下操作:

In the Project Explorer, right-click your project and select Properties.
In the category panel on the left side of the dialog, select Android.
In the Library pane, click the Add button.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.
使用Eclipse

基于支持库代码创建库项目:

Make sure you have downloaded the Android Support Library using the SDK Manager.
Create a library project and ensure the required JAR files are included in the project's build path:
    Select File > Import.
    Select Existing Android Code Into Workspace and click Next.
    Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/.
    Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
    In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
    Right-click the library project folder and select Build Path > Configure Build Path.
    In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
    Uncheck Android Dependencies.
    Click OK to complete the changes.
注意:如果您使用的是android-support-v7-mediarouter支持库,请注意它取决于android-support-v7-appcompat库。为了编译v7 mediarouter库,必须将这两个库项目导入到开发工作区中。然后按照上面的过程将v7 appcompat项目作为库添加到v7 mediarouter库项目中。 发件人:

In the Project Explorer, right-click your project and select Properties.
In the category panel on the left side of the dialog, select Android.
In the Library pane, click the Add button.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.