hodgesmr
hodgesmr

Reputation: 2785

Android build path after SVN Checkout

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:

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?

Upvotes: 1

Views: 2480

Answers (2)

davogotland
davogotland

Reputation: 2777

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

  • Go to Window -> Preferences
  • Select Android
  • To the right of SDK Location:, click Browse...
  • Find the Android SDK directory on your computer and click OK
  • Click OK again
  • Go to Window -> Show View -> Other...
  • Select Android -> LogCat
  • Click OK

Setting up the Android application project

  • Select File -> New -> Project...
  • Select Android -> Android Project
  • Click Next >
  • In Project name: enter
  • Check Create project from existing source
  • Click Browse... and find the folder "trunk\code\client\java" in your repository note that this will be different for you
  • Make sure Build Target Android 2.1 is checked note that this might be different for you... old guide is old!
  • Click Finish

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

  • Right click the "gen"-folder, select Build Path -> Remove from Build Path
  • Right click the "gen"-folder, select Build Path -> Use as Source Folder
  • If there's still a problem, try going to the menu and selecting Project -> Build Project or Project -> Clean... and then pressing OK

Setting up an Android Virtual Device

  • In Eclipse, go to Window -> Android SDK and AVD manager
  • Click New...
  • Select a name (make sure to remember the name if you're going to use your own server on your local machine)
  • Under Target, select Android 2.1.... old guide is still old...
  • Set SD Card -> Size to 128 MB
  • Click New..., select Abstracted LCD density, click OK
  • Click New..., select Keyboard support, click OK
  • Click New..., select Device ram size, click OK
  • Click New..., select Touch-screen support, click OK
  • Click Create AVD

Starting an Android Virtual Device

  • Go to Window -> Android SDK and AVD manager
  • Click on the Andoird Virtual Device you want to start
  • Click Start...

Starting the application inside your Android Virtual Device

  • Right click the client project inside Eclipse, and select Run As->Android Application. The application will be sent to the virtual device and executed there

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 :)

Upvotes: 1

Heiko Rupp
Heiko Rupp

Reputation: 30934

Looks like you need to go to the project preferences and adjust the settings for the used JDK and Android SDK - Eclipse stores them in .project and .classpath files. The content of those files may not match the layout of *DKs on your computer.

Upvotes: 0

Related Questions