Reputation: 1363
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
Upvotes: 69
Views: 153915
Reputation: 1489
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.
Upvotes: 127
Reputation: 11
I encountered with the similar problem..... Make sure that
If the first step is clear, then go for this.....
Upvotes: 1
Reputation: 137
I had to delete R.java
in the gen
folder, then do a clean build. This solved my issue.
Upvotes: 0
Reputation: 3907
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:
import
block.AndroidManifest.xml
).Upvotes: 0
Reputation: 2524
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.
Upvotes: 3
Reputation: 488
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
Upvotes: 4
Reputation: 2728
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.
Upvotes: 0
Reputation: 12367
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".
Upvotes: 47
Reputation: 21618
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.
Upvotes: 0
Reputation: 11109
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.
Upvotes: 0
Reputation: 651
I know this is too late. but I am also facing this issue and I fix this by following below steps.
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.
Upvotes: 0
Reputation: 1871
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'
Upvotes: 61
Reputation: 77
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$#@!!!
Upvotes: 2
Reputation: 21
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)
Upvotes: 2
Reputation: 2506
For me this problem was related to OpenJDK 6 on Ubuntu.
Update your JRE or install Sun's proprietary JRE instead and restart Eclipse.
Upvotes: 0
Reputation: 6121
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.
Upvotes: 0
Reputation: 16780
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'.
Upvotes: 3