Java 首次android应用程序错误

Java 首次android应用程序错误,java,android,eclipse,Java,Android,Eclipse,这是我第一次使用eclipse和android,我只是想创建一个项目 我完成了创建一个新的android项目的步骤,创建了一个简单的helloworld apk,可以在我的手机上使用 我自己还没有添加任何代码,但是有很多错误,没有任何东西可以编译。我不知道该怎么办。请有人帮忙。下面是所有的代码和错误 Mainactivity.java package com.rikin.myfirstapplication; import android.support.v7.app.ActionBa

这是我第一次使用eclipse和android,我只是想创建一个项目

我完成了创建一个新的android项目的步骤,创建了一个简单的helloworld apk,可以在我的手机上使用

我自己还没有添加任何代码,但是有很多错误,没有任何东西可以编译。我不知道该怎么办。请有人帮忙。下面是所有的代码和错误

Mainactivity.java

    package com.rikin.myfirstapplication;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;


public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }   


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}
Activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.rikin.myfirstapplication.MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

</RelativeLayout>
错误:

还可以得到以下信息:

转到属性->Android->添加appcompat_v7库


您的项目中是否有名为appcompat v7的库?在您的工作区中?我想是的,我确实拥有它。/转到您的LIB并删除v7。.右键单击v7 appcompat项目,单击属性,然后单击android检查项目的构建目标是否不小于16左右。。将其重新导入到您的项目中,从v7文件夹的lib文件夹复制v7 jar并将其添加到您的项目右键单击jar并将其添加到build path clean and rebuild。。让我知道它是否有助于继续在控制台中获取错误,同时获取这些错误哇,创建一个新项目和一个新的工作区所有这些都没有给我这个库的选项:啊,所有这些都很烦人我可能你必须下载它:库已经设置好了。我认为这不能解决问题