The project was not built since its build path is incomplete

AndroidEclipseProjectLibrariesTarget

Android Problem Overview


Every time I try to import a project downloaded from googlecode into Eclipse but I get some errors:

> The project was not built since its build path is incomplete. Cannot > find the class file for java.lang.Object. Fix the build path then try > building this project > > Unable to resolve target 'android-10' (this changes from 1 to 15)

I've already checked the other answers on the site but no solution worked.

In

> Properties -> Java Build Path -> Libraries

there's 1 item:

> Unable to get system libraries for the project

Android Solutions


Solution 1 - Android

Right click on project -> Properties -> Java Build Path (From Left List) -> Libraries (Tab) -> Add Library (Button on right) -> JRE System Library -> Next -> Workspace default JRE -> Finish

This should solve at least one of your errors. Any others might require you to add further libraries.

Hope this helps.

Solution 2 - Android

Close eclipse and re-open worked for me. You may have to do this two or three times. Each time give it a minute for the auto build startup process (check bottom right hand corner) to complete, as these errors often disappear at this time.

Or try to clean the affected projects.

'Turn it off and on again'

Solution 3 - Android

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".

Solution 4 - Android

Initially I was trying to import an android project from github and encountered the above problem

  • cannot configure build path

  • unable to get system libraries


> Package Explorer -> Right click the project -> “Properties” -> > "Android" -> "Project Build Target" = 2.3.3

Note: Also try Clean (On Windows: Project -> Clean) then Refresh (F5) at random. There's a good chance this will magically solve all your problems.


courtesy: KYLE CLEGG
reference link

Solution 5 - Android

Goto eclipse → Preferences → Java → Build path.

Do you see a JRE_LIB configured there? If not, add JRE_LIB from JDK/jre lib location. These can be overridden per project. It seems your eclipse isn't aware of Java libraries.

Solution 6 - Android

None of this worked for me. I created a new workspace for the projects. That worked for me! Switching to a new workspace usually miraculously solves a lot of these configuration problems. Simply create a new folder where you would want your new workspace to be and then use 'import project from existing code'.

Solution 7 - Android

I have seen such errors in past while importing projects in eclipse. The solution to that is to go to properties->Android and select project build target appropriately (Android x.x.x or Google APIs)

Solution 8 - Android

Was struggling with this while trying to load the Vuforia Sample App for way too long today. The solution that finally got my project to build was:

1) Window->Android SDK Manager and Install the latest updates
2) Project->Build Path->Configure Build Path->Android and under Project Build Target mark Android 4.4.2 and click OK
3) Clean, Build and Run

I hope this solves somebody else's issue as well, Eclipse is frustrating as F$#@!!!

Solution 9 - Android

I encountered with the similar problem..... Make sure that

  1. You create your project within your workspace. If your project is not in the default workspace where .metadata folder within which other plugin folders, and etc. will be present, then it will ask you to configure build path as the project is not build because of incomplete build path.

If the first step is clear, then go for this.....

  1. Right click on your project -> build path -> configure build path -> libraries -> Add libraries -> JRE system libraries -> Apply and close.

Solution 10 - Android

I had to delete R.java in the gen folder, then do a clean build. This solved my issue.

Solution 11 - Android

Steve's answer does help for some projects, but still, for some projects, it remains the same. I guess that projects were previously build-in early JDK 1.5 (in my case). But I found a workaround for them:

  1. Find the class that causes the problem (Keep expanding the project in the Package Explorer).
  2. Copy the class's contents after the import block.
  3. Delete the whole class.
  4. Right Click on the project then Android Tools >> Fix Project Properties
  5. Create a class with the same name under the same package the deleted class was before. (If the project is imported and the deleted class was an Activity/Service/Provider/Reciever, I guess the class is already included in the AndroidManifest.xml).
  6. Paste the content of the class and import packages.
  7. Clean the project.

Solution 12 - Android

I've had similar problem. Exact same error, but in Ubuntu after I worked on project in dropbox folder from Windows. I've just added android.jar to project. Somehow it disappeared from build path.

Solution 13 - Android

For me this problem was related to OpenJDK 6 on Ubuntu.

Update your JRE or install Sun's proprietary JRE instead and restart Eclipse.

Solution 14 - Android

I know this is too late. but I am also facing this issue and I fix this by following below 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.

Solution 15 - Android

I had my "Build Automatically" turned off in "Project". I turned it off, because the Eclipse was not loading the projects correctly, for various unknown reasons. Turning this on, solved my problem.

Solution 16 - Android

if the project is not very big, you can copy the packages and paste it into a new project, you won't see the errors in the new project.

Solution 17 - Android

I was having target-18 in my project.properties. But I wasn't having android-18 sdk. So I changed 18 to some other version which I had in my SDK manager, and it fixed the issue.

Solution 18 - Android

You just exit eclipse once or twice to reload. It works for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAngelo TricaricoView Question on Stackoverflow
Solution 1 - AndroidSteveView Answer on Stackoverflow
Solution 2 - AndroidHevskiView Answer on Stackoverflow
Solution 3 - AndroidKonstantin PribludaView Answer on Stackoverflow
Solution 4 - AndroidAnupView Answer on Stackoverflow
Solution 5 - AndroidAnirudhView Answer on Stackoverflow
Solution 6 - AndroidNamrathaView Answer on Stackoverflow
Solution 7 - AndroidsunilView Answer on Stackoverflow
Solution 8 - Androida.scarlettView Answer on Stackoverflow
Solution 9 - AndroidSyed HussainiView Answer on Stackoverflow
Solution 10 - AndroidTylerView Answer on Stackoverflow
Solution 11 - AndroidIronBlossomView Answer on Stackoverflow
Solution 12 - Androiduser1685095View Answer on Stackoverflow
Solution 13 - AndroidtpbappView Answer on Stackoverflow
Solution 14 - AndroidPrakash MView Answer on Stackoverflow
Solution 15 - AndroidVamsi ChallaView Answer on Stackoverflow
Solution 16 - AndroidtokhiView Answer on Stackoverflow
Solution 17 - AndroidberserkView Answer on Stackoverflow
Solution 18 - AndroidMaxxView Answer on Stackoverflow