The project was not built since its build path is incomplete
AndroidEclipseProjectLibrariesTargetAndroid 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
- 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.....
- 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:
- Find the class that causes the problem (Keep expanding the project in the Package Explorer).
- Copy the class's contents after the
import
block. - Delete the whole class.
- Right Click on the project then Android Tools >> Fix Project Properties
- 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
). - Paste the content of the class and import packages.
- 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.
- This issue is occurred only if the project shared between different machines.
- For me I found java JDK is the problem.
- My colleague used mac system and using jdk 1.7. but in my system I used jdk 1.6.
- I guess that may be the issue. So I select project and open properties and change my jdk to 1.7
- Change target=Google Inc.:Google APIs:19
- 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.