I just checked out an Android project into Eclipse over SVN. The project has a few packages within it, and one of them is marked with having three 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
- The type java.lang.Object cannot be resolved. It is indirectly referenced from a required .class file
- Unable to resolve target ‘android-8’ until SDK is loaded\
I’ve worked on Android projects in Eclipse before, but this is my first time attempting to start by checking one out from subversion. How can I fix these errors?
it’s a bit tricky to set up a project from a source repository. you must follow each step! here’s a guide i once wrote for becoming a member of one my projects using eclipse (it’s for eclipse galelieo, so some of the buttons and fields may have moved or changed names slightly depending on what version you’re on):
Selecting workspace
The first step is to select an Eclipse workspace. It could be an existing one, or a new one. Either way, it must be in a location which is not related to the code repository. The workspace folder must not be inside the code repository, and the code repository must not be inside the workspace folder.
Configuring Eclipse’s Android specific settings
Setting up the Android application project
note that this will be different for younote that this might be different for you... old guide is old!After this step, you may have an error in your project. This is because Eclipse is too fast for itself. Check your Problem-tab: If there’s an error saying that the project is missing its “gen”-folder, this is what you do
Setting up an Android Virtual Device
old guide is still old...Starting an Android Virtual Device
Starting the application inside your Android Virtual Device
final notes
eclipse will want to add files to your source folder. files that are local to your computer and shouldn’t go into the repository. when you commit, take note of what files they are, and add these to your ignore-list, if they aren’t already there 🙂