2

I have an android project and I have added it to an SVN repository. These are the directories/files I have added

Directories : res, src, lib,

Files : AndroidManiFest.xml, project.properties, proguard.cfg, and 2 launch files

However, when i do the following, I'm not able to create the file as an android project

  1. Import project by checking out from SVN (this is a project A)
  2. Using the create new project in eclipse to create the new project - steps are : Create New Projects -> Android Project from Existing Source Code

Are thee some files that I have not committed or am I doing something wrong when I'm creating the new project?

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Arvind Sridharan
  • 3,885
  • 4
  • 29
  • 54
  • 1
    Clarify "create a new android project from existing source code". Are you copying the source files? Or are you copying the repository? Or do you create a new repository for the new project? Or do you change the existing files in the existing repository? – Mizipzor Jul 04 '12 at 09:28
  • i have clarified .. pls ask if more is needed – Arvind Sridharan Jul 04 '12 at 09:30
  • possible duplicate of [Android+Eclipse project sharing via SVN?](http://stackoverflow.com/questions/3166947/androideclipse-project-sharing-via-svn) – FoamyGuy Jul 05 '12 at 20:10

6 Answers6

16

I spent a lot of time trying to import an Android project from a web based SVN provider into Eclipse (Juno).

Seeing how hard it was for me to find out the correct steps, I leave here my suggestion with screenshots. Enjoy!

  • You must have SVN already installed and configured. No previous project is needed in Eclipse You must have SVN already installed and configured. No previous project is needed in Eclipse

  • I already had the connection to the provider correctly configured due to previous attempts. YMYV here. I already had the connection to the provider correctly configured due to previous attempts. YMYV here.

  • I use SVNKit 1.7 because it will work just fine over a proxy here at work. I use SVNKit 1.7 because it will work just fine over a proxy here at work.

  • Here is the most important step: make sure the Find projects in the children option is selected Here is the most important step: make sure the Find projects in the children option is selected.

  • Choose Checkout as a project Choose checkout as a project

  • Choose whatever workspace you need Choose whatever workspace you need

  • And voilá, the project is ready to roll! And *voilá*, the project is ready to roll!

I added descriptions into the images, for your viewing pleasure. Hope it saves someone a lot of time as it did to me after figuring out the correct steps.

Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Henrique de Sousa
  • 5,727
  • 49
  • 55
  • I follow this steps but I receive this message: There are no projects found. In SVN I ignore the folder bin, gen and the file .setting .project .classpath how explain in this tutorial http://www.mokasocial.com/2010/11/ignoring-android-files-with-subversion/ – DrFred Jan 10 '14 at 07:37
  • Then probably 1) the project you have in SVN wasn't an Eclipse project in the first place or 2) The path you provided to Eclipse in Sshot #2 is not the correct one. – Henrique de Sousa Jan 10 '14 at 13:44
  • How i configure server side.? – Pratik Butani Feb 14 '14 at 05:16
  • As I stated, "I already had the connection to the provider correctly configured due to previous attempts", so I think you're better off creating a new Question. I should need to provide to Eclipse a pasted URL from the web provider, or figure out the url if the server is local. – Henrique de Sousa Feb 14 '14 at 17:41
3

In Eclipse try:

Right click in project view.

-> Import

-> Enter Android

-> Select "Existing Android Code Into Workspace"

-> Select your checked out svn folder.

finish. :)

Community
  • 1
  • 1
Fabian
  • 2,693
  • 2
  • 21
  • 33
  • what you have said is correct .. i had to checkout the project outside of eclipse (i.e. using the command svn checkout in my terminal - ubuntu) to get it working. – Arvind Sridharan Jul 04 '12 at 09:41
1

The easiest way to checkout an Android Project with Eclipse is the use the plugin "Subclipse" (http://subclipse.tigris.org). With this plugin, directly on Eclipse you can checkout "as android project"

Aurélien Guillard
  • 1,203
  • 8
  • 20
  • this question has nothing to do with which SVN client i should use - infact in the question itself i've mentioned that i'm using eclipse to checkout my project – Arvind Sridharan Jul 04 '12 at 12:16
  • I am trying out this now. But this seems to be exactly what I am looking for. Question Asker seems clueless... – Dan Ciborowski - MSFT Jan 24 '13 at 21:30
  • @ArvindSridharan, this answer is not about the client. This plugin performs a client action as well as dealing with the necessary android specific folder requirements – Vass Mar 04 '13 at 14:49
1

I'm not sure why, but I'm missing the "Find projects in the children" option. I'm using Eclipse Kepler Service Release 2 with the latest Subclipse as of this writing. Here is the workaround. This method also preserves the ability to commit your changes, unlike some instructions I found on this site.

  1. Create a temp directory under your default workspace directory (may not necessarily need to be under workspace, but it works)
  2. Import your project from SVN into the temp directory through Eclipse
  3. Delete the project, don't check "Delete files"
  4. Import Android project from existing code, choose your imported project in the temp directory
  5. Refactor - > Move, check "Use default location". This moves the project from the temp directory to your regular workspace, i.e. one level up.
OneWorld
  • 17,512
  • 21
  • 86
  • 136
biggvsdiccvs
  • 299
  • 3
  • 12
  • Works! See my answer. I improved your workflow like this: I did not checkout into a temp directory and had not to move it back. Moving caused problems with libraries. – OneWorld Nov 13 '14 at 14:58
1

Despite of biggvsdiccvs I skipped using a temp directory which helped to avoid problems with referenced libs like the android support library.

  1. Install Subclipse and SVNKit (video tutorial 0:12)
  2. Switch to SVN perspective and add your repository (video tutorial 1:12)
  3. Switch back to Java perspective and Choose "File > Import > SVN > Checkout Projects from SVN" using your freshly installed SVN Eclipse plugin or follow video tutorial 1:42
  4. Select your repo
  5. Choose "Checkout as project with the name specified"
  6. Choose "Checkout as projects into Workspace"
  7. Enable "Use default workspace location"
  8. Delete the project, don't check "Delete files"
  9. Import Android project from existing code, choose your imported project
OneWorld
  • 17,512
  • 21
  • 86
  • 136
  • Now switched to [Subversive](http://www.eclipse.org/subversive/). The workflow is pretty much the same. The key is to convert the project into an android project by deleting the checked out project and importing it as Android project. – OneWorld Apr 30 '15 at 12:50
-1

Use TortoiseSVN. You can also use it for Git.To properly upload and download your files from SVN. Maybe your SVN client not working correctly.

Vipul Purohit
  • 9,807
  • 6
  • 53
  • 76