ssj3goku878
ssj3goku878

Reputation: 755

Cannot reference main android Library

I am having some major issues here after updating to android API 20, after creating a new android project on eclipse, I got flagged for tons of bus as you can see below

Description Resource    Path    Location    Type
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 8  Java Problem
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 12 Java Problem
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 32 Java Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.   styles.xml  /testone/res/values-v14 line 8  Android AAPT Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml  /testone/res/values line 7  Android AAPT Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml  /testone/res/values-v11 line 7  Android AAPT Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 13 Java Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 19 Java Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 29 Java Problem
The import android.support.v7 cannot be resolved    MainActivity.java   /testone/src/com/example/testone    line 3  Java Problem
The method getMenuInflater() is undefined for the type MainActivity MainActivity.java   /testone/src/com/example/testone    line 19 Java Problem
The method onCreate(Bundle) of type MainActivity must override or implement a supertype method  MainActivity.java   /testone/src/com/example/testone    line 11 Java Problem
The method onCreateOptionsMenu(Menu) of type MainActivity must override or implement a supertype method MainActivity.java   /testone/src/com/example/testone    line 17 Java Problem
The method onOptionsItemSelected(MenuItem) of type MainActivity must override or implement a supertype method   MainActivity.java   /testone/src/com/example/testone    line 24 Java Problem

I already tried several methods that I found online but nothing seems to work. I tried: Fix project properties option doesnt do anything, when I try to add the library manually, I find that the appcompat_v7 is missing and when I try to add another library, the add library drop down menu is grayed out and cannot be selected. So I'm not really sure what to do here and i'm at a complete loss.

Upvotes: 1

Views: 811

Answers (1)

Lucky Rana
Lucky Rana

Reputation: 1050

I was also stuck with the same issue few day ago,

I resolved the same issue by updating sdk to latest version 23.0.4. and extras: Android support Repository to rev. 6 Android support Library to rev. 20

first of all open up your Android sdk Manager from eclipse and download all latest sdk updates and extra downloads.

And then after downloading all updates , you have need to use a fresh Eclips editor because your existing eclipse will not let you successfully update from Android sdk tool 20 to 21.0.4 Then just use a fresh eclips editor and set up updated android sdk path in the fresh eclips (the same one you have used in your last eclipse editor , you can find it at Window>> Prefrences >> Android).

Hopefully this will solve your problem.

Upvotes: 1

Related Questions