Reputation: 653
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.
Upvotes: 0
Views: 442
Reputation: 298
Do the following steps , this may help:
if problem still persist , restart eclipse.
Upvotes: 0
Reputation: 5261
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.
Upvotes: 1