0

I don't know why there are so many errors. I think I am missing the app theme but I don't know how to add it if you would show me that would be great, thank you. I thought I installed all the necessary items.

package com.example.helloworld;

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

Log

[2016-08-09 20:13:03 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:03 - HelloWorld] 
[2016-08-09 20:13:03 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:03 - HelloWorld] 
[2016-08-09 20:13:03 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2016-08-09 20:13:03 - HelloWorld] 
[2016-08-09 20:13:04 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:04 - HelloWorld] 
[2016-08-09 20:13:04 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:04 - HelloWorld] 
[2016-08-09 20:13:04 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2016-08-09 20:13:04 - HelloWorld] 
[2016-08-09 20:13:26 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:26 - HelloWorld] 
[2016-08-09 20:13:26 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
[2016-08-09 20:13:26 - HelloWorld] 
[2016-08-09 20:13:26 - HelloWorld] H:\Eclipse workspace\HelloWorld\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
[2016-08-09 20:13:26 - HelloWorld] 
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
J Thunder
  • 1
  • 1
  • first you are missing this theme Theme.AppCompat.Light' – Charuක Aug 10 '16 at 02:47
  • Those errors are related to xmls in your res folder and have nothing to do with the Java code. Try updating your question with the contents of your styles xmls. – ziondreamt Aug 10 '16 at 02:47
  • As per [google annoncement](http://android-developers.blogspot.in/2015/06/an-update-on-eclipse-android-developer.html) Google Ends Support for Android Eclipse Tools.you have to start your new project on studio – krishnan muthiah pillai Aug 10 '16 at 04:07
  • @krishnan While I agree with you that Android Studio should be used, we aren't Google, so we support anyone with reasonable questions. – OneCricketeer Aug 10 '16 at 13:02
  • Possible duplicate of [No resource found that matches the given name '@style/Theme.AppCompat.Light'](http://stackoverflow.com/questions/21059612/no-resource-found-that-matches-the-given-name-style-theme-appcompat-light) – OneCricketeer Aug 10 '16 at 13:04

1 Answers1

0

AppCompat is a library project. You need to reference the library project in your android project.

Check this for information on adding library with resources - https://developer.android.com/tools/support-library/setup.html#add-library.

Though, I also agree with krishnan's comment - switch to Android Studio and save yourself some trouble :)

Hope this helps!

theabhinavdas
  • 454
  • 4
  • 16