0

Good evening! I just updated eclipse and when i was done, almost every line of code is marked as an error. I found this solution (which i think was part of the problem) but i still get all of the errors.

I installed android API 18, installed LVL and updated a couple of packages.

            Description Resource    Path    Location    Type
    color cannot be resolved to a variable  AmountEdit.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/TransactionEdit line 77 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 44 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 43 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 43 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 44 Java Problem
    R cannot be resolved to a variable  Amount.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/Datastructure/Amount    line 41 Java Problem
    R cannot be resolved to a variable  AmountEdit.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/TransactionEdit line 50 Java Problem
    R cannot be resolved to a variable  AmountEdit.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/TransactionEdit line 45 Java Problem
    R cannot be resolved to a variable  AmountEdit.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/TransactionEdit line 55 Java Problem
    R cannot be resolved to a variable  AmountEdit.java /Spendo2/src/com/SverkerSbrg/Spendo/Transaction/TransactionEdit line 52 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 38 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 53 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 49 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 24 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 44 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 39 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 34 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 22 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 30 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 26 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 22 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 38 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 53 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 53 Java Problem
    R cannot be resolved to a variable  About.java  /Spendo2/src/com/SverkerSbrg/Spendo/MiscTab line 53 Java Problem
    FragmentStatePagerAdapter cannot be resolved to a type  SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 67 Java Problem
    FragmentManager cannot be resolved to a type    SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 68 Java Problem
    Fragment cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 73 Java Problem
    FragmentManager cannot be resolved to a type    SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 68 Java Problem
    Fragment cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 73 Java Problem
    FragmentStatePagerAdapter cannot be resolved to a type  SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 67 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 61 Java Problem
    MiscTabFragment cannot be resolved to a type    SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 84 Java Problem
    PTHandler cannot be resolved    SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 56 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 22 Java Problem
    PagerAdapter cannot be resolved to a type   SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 24 Java Problem
    FragmentActivity cannot be resolved to a type   SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 61 Java Problem
    MiscTabFragment cannot be resolved to a type    SpendoLite.java /SpendoLite/src/com/SverkerSbrg/SpendoLite  line 84 Java Problem
    PTHandler cannot be resolved    SpendoFull.java /SpendoFull/src/com/SverkerSbrg/SpendoFull  line 56 Java Problem

The problem effects all of my projects in eclipse. I have tried to clean and restart several times (including the desktop itself).

UPDATE: I've think i have one main problem in the so called library project. Where The problem perists (633 times)

Description Resource    Path    Location    Type
R cannot be resolved to a variable  CategoryEdit.java   /Spendo2/src/com/SverkerSbrg/Spendo/Category    line 98 Java Problem
Community
  • 1
  • 1
SverkerSbrg
  • 503
  • 1
  • 9
  • 23
  • Right click on one of the projects, choose properties > in the left pane, choose Android > Check if any of the referenced libraries is showing as broken. – Vikram Sep 26 '13 at 21:43
  • Something is clearly wrong here. I currently have 3 projects, one library and then 2 light versions using the library. The library have been unmarked as library and the references to it in the other 2 have disappeared. And i get no response when i try to readd it. – SverkerSbrg Sep 26 '13 at 21:47
  • I seem unable to turn the former library into a library project... – SverkerSbrg Sep 26 '13 at 21:48
  • Right click on the library project, choose properties > in the left pane, choose Android > check the `Is Library` checkbox. Add the library to other projects. – Vikram Sep 26 '13 at 21:51
  • I've tried this but after i close the box, it reverts automatically. suppose it is because of the errors preventing it from compiling – SverkerSbrg Sep 26 '13 at 21:53
  • One good thing is that you have a total of 6 projects. Choose the most independent one (library or not), delete it, and then import it. Does that change anything for _that_ project? If yes, then rinse and repeat. – Vikram Sep 26 '13 at 21:55
  • No difference i'm afraid :( – SverkerSbrg Sep 26 '13 at 21:59
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/38129/discussion-between-user2558882-and-sverkersbrg) – Vikram Sep 26 '13 at 22:07

1 Answers1

0

This is quite normal. And, could happen for many reason.

Sometime i run into error, like R is not generating coz their is an error in the code. And, the error is in code because it can not find the reference of the resource from R.

Try to recreate your R file. usually Project -> clean work for this.

When you have multiple projects, remove all then try adding one by one. Add first one, compile that if that one is ok then add next project.

Some time with multiple projects, some dependency file added multiple times. make sure that on Android libraries are added as Android Library on Android Build Path. And, Java Libraries are on Java Build path. if you see any library or support jar multiple time remove it.

On Eclipse properties, Android Properties -> Android isLibrary Java Properties->java Build Path

minhaz
  • 4,233
  • 3
  • 33
  • 49