0

In Eclipse i'm going to File > New > Other > Android Application Project I give a name then click next next next finish when it's creating the new project i'm getting errors in the console window:

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'

6 errors all in styles.xml

Also i'm getting errors in the MainActivity.java and i didn't change anything didn'nt even open the MainActivity.java yet.

This is the main activity java code i didn't touch or changed anything.

package com.example.texttospeech;

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);
    }
}

All packages in the android sdk manager already installed. i'm targeting the project to compile on minimum 7 maximum 18.

First it was 21 so i created new project targeting and compiling 18.

But same errors. I didn't have it before.

I remember i deleted a project name: appcompat_v7 maybe i need this ? If so how to get it ?

Anyway i googled and so far no solution for me.

1
  • The support library jars should be in sdk\extras\android\support\v7\appcompat\libs, but it would probably be easier to just recreate a new project. Commented Jul 21, 2015 at 23:22

2 Answers 2

1

Go to the android sdk folder-> extras -> android -> support -> v7

Import the appcompat folder present in v7 folder in eclipse and then add this library to your project. This should solve your problem.

Sign up to request clarification or add additional context in comments.

Comments

0

Do the following steps , this may help:

  1. import android.app.Activity; paste this line in imports
  2. Replace ActionBarActivity with Activity.
  3. Remove all methods except onCreate for now.
  4. Clean and Rebuilt project.

if problem still persist , restart eclipse.

1 Comment

oops forgot to mention appcompat_v7 , @Aakash mentioned it anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.