简体   繁体   中英

How do i checkout an android project from an SVN repository

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?

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 您必须已安装和配置SVN。 Eclipse中不需要以前的项目

  • I already had the connection to the provider correctly configured due to previous attempts. YMYV here. 由于之前的尝试,我已经正确配置了与提供商的连接。 YMYV在这里。

  • I use SVNKit 1.7 because it will work just fine over a proxy here at work. 我使用SVNKit 1.7,因为它在工作时可以正常工作。

  • Here is the most important step: make sure the Find projects in the children option is selected 这是最重要的步骤:确保选中子项中的查找项目选项。

  • Choose Checkout as a project 选择结帐作为项目

  • Choose whatever workspace you need 选择您需要的任何工作区

  • And voilá, the project is ready to roll! 并且*voilá*,该项目已准备就绪!

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.

In Eclipse try:

Right click in project view.

-> Import

-> Enter Android

-> Select "Existing Android Code Into Workspace"

-> Select your checked out svn folder.

finish. :)

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"

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, ie one level up.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM