0

I'm writing an Android application. I want to open it and run it but it is giving 1 error and 1 warning:

The project was not built since its build path is incomplete. Cannot find the class file for android.content.Context. Fix the build path then try building this project The type android.content.Context cannot be resolved. It is indirectly referenced from required .class

How do I fix this?

JAL
  • 41,701
  • 23
  • 172
  • 300
Suleman Jamil
  • 43
  • 1
  • 7
  • 2
    add your log, then code, then reformat your post to be more readable – piotrek1543 Jan 06 '16 at 21:58
  • Please include the relevant code. Does the error refer to a line number or place where it arises? – Nathaniel Ford Jan 08 '16 at 22:33
  • [Checkout this link, hope it may help you out, as recently I have resolved this issued by following the solution, it usually occurs due to previously added build-path with eclipse](https://stackoverflow.com/a/46806124/3184239) – Awais Oct 18 '17 at 08:52
  • [Hope this one helps, the issue may exist due to build-path binding issue, may occur to change in eclipse version while having previous bindings of maven dependencies](https://stackoverflow.com/a/46806124/3184239) – Awais Oct 18 '17 at 08:55

1 Answers1

0

Reason of this problem is:

It seems that you lack JDK (java.lang.Object comes from there )

The problem is that you used the same Android API on different PC. Eclipse is lost with path names that are differents but with same API.

To solve it, first re-select Android API version (set to another one and valid, then restore the on you want and validate it -> it will force Eclipse to reload API). Then go into project->properties-> java build path. Then remove "Unable to get system library for the project" then "Add library" and select "Android Classpath container".

From: The project was not built since its build path is incomplete

If above solution didn't work, follow these steps:

  1. This issue is occurred only if the project shared between different machines.
  2. For me I found java JDK is the problem.
  3. My colleague used mac system and using jdk 1.7. but in my system I used jdk 1.6.
  4. I guess that may be the issue. So I select project and open properties and change my jdk to 1.7
  5. Change target=Google Inc.:Google APIs:19
  6. Clean & Build

Finally issue is fixed. I think this is because of If you build your project with higher JDK version thereafter you should build with same version.

NOTE : we are not facing this issue before until my colleague build with JDK 1.7. After he started to using JDK 1.7 only this issue occur.

Hope it will work for some one. And no need for install new eclipse.

From: The project was not built since its build path is incomplete

Check link above to find more solutions

Hope it helps

Community
  • 1
  • 1
piotrek1543
  • 19,130
  • 7
  • 81
  • 94