打开从 svn 检出的 android 项目时出现错误“无法使用 subversion 命令行客户端:svn”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22572861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:11:22  来源:igfitidea点击:

Error "can't use subversion command line client : svn" when opening android project checked out from svn

androidsvntortoisesvnandroid-studio

提问by har07

I'm new to Android development and the development tools around it. I have checked out a project from svn using TortoiseSVN client (can't manage to do it from within Android Studio), then get this error message after importing the project to Android Studio:

我是 Android 开发和围绕它的开发工具的新手。我已经使用 TortoiseSVN 客户端从 svn 签出一个项目(无法在 Android Studio 中执行此操作),然后在将项目导入 Android Studio 后收到此错误消息:

can't use subversion command line client : svn

Probably the path to Subversion executable is wrong. Fix it..

不能使用 subversion 命令行客户端:svn

Subversion 可执行文件的路径可能是错误的。修理它..

When I click "Fix it" link, this dialog pops up:

当我单击“修复它”链接时,会弹出此对话框:

enter image description here

在此处输入图片说明

But I still have no idea what I am supposed to do to fix this? Any kind of help/suggestion/direction to fix the problem are welcome.

但我仍然不知道我应该怎么做才能解决这个问题?欢迎任何类型的帮助/建议/方向来解决问题。

回答by janos

Android Studio cannot find the svncommand because it's not on PATH, and it doesn't know where svnis installed.

Android Studio 找不到该svn命令,因为它不在 上PATH,并且不知道svn安装在哪里。

One way to fix is to edit the PATHenvironment variable: add the directory that contains svn.exe. You will need to restart Android Studio to make it re-read the PATHvariable.

一种修复方法是编辑PATH环境变量:添加包含svn.exe. 您需要重新启动 Android Studio 以使其重新读取PATH变量。

Another way is to set the absolute path of svn.exein the Use command client boxin the settings screen that you included in your post.

另一种方法是在帖子中包含的设置屏幕svn.exe中的“使用命令客户端”框中设置 的绝对路径。

UPDATE

更新

According to this other post, TortoiseSVN doesn't include the command line tools by default. But you can re-run the installer and enable it. That will add svn.exeto PATH, and Android Studio will correctly pick it up.

根据一篇文章,TortoiseSVN 默认不包含命令行工具。但是您可以重新运行安装程序并启用它。这将添加svn.exePATH,Android Studio 将正确地选择它。

回答by cosbor11

This is annoying, I wish IntelliJ would handle this better than a startup nag..

这很烦人,我希望 IntelliJ 能比启动唠叨更好地处理这个问题。

If you are using TortoiseSVN 1.8+ on Windows, do this:

如果您在 Windows 上使用 TortoiseSVN 1.8+,请执行以下操作:

  1. Run the the TortoiseSVN Installer. (It may still be in your Downloads folder)
  2. Select the option to Modify.
  3. Install Command line client toolson to the local harddrive.
  4. Add C:\Program Files\TortoiseSVN\binto your Pathenvironment variable.
  5. Restart IntelliJ.
  1. 运行TortoiseSVN 安装程序。(它可能仍在您的下载文件夹中)
  2. 选择选项Modify
  3. 在本地硬盘上安装命令行客户端工具
  4. 添加C:\Program Files\TortoiseSVN\bin到您的Path环境变量。
  5. 重新启动 IntelliJ。

回答by Manoj Behera

Saw your problems.

看到你的问题了。

Solutions:

解决方案:

FirstDownload Subversion 1.8.13 ( 1.8 )client Download link (https://subversion.apache.org/packages.html) at the time of this post the android studio version is less than 1.4in my case 1.3.2so you must avoid the issues here subversion command line client version is too oldso just download the 1.8preferably.

首先下载 Subversion 1.8.13 ( 1.8 )客户端 下载链接 ( https://subversion.apache.org/packages.html) 在本文发布时,android studio 版本低于1.4在我的情况下为1.3.2所以你必须避免这里的问题subversion 命令行客户端版本太旧,所以最好下载1.8

enter image description here

在此处输入图片说明

Then unzippedin a folder. There will have one folder "bin".

然后解压到一个文件夹中。将有一个文件夹“ bin”。

Then

然后

Goto settings - > Version control -> Subversion

settings - > Version control -> Subversion

Copythe url of your downloaded svn.exethat is in bin folder that you have downloaded.

复制您下载的svn.exe的 url,该svn.exe位于您下载的bin 文件夹中。

follow the picture:

按照图片:

enter image description here

在此处输入图片说明

Don't forget to give the end name like svn.exelast as per image.

不要忘记根据图像最后给出像svn.exe这样的结束名称。

Apply -> Ok

Apply -> Ok

Restartyour android studio now.

现在重启你的安卓工作室。

Happy Coding!

快乐编码!

回答by anand krish

First install TortoiseSVN. During installation follow this steps

首先安装TortoiseSVN。在安装过程中,请按照以下步骤操作

1.Run the the TortoiseSVN Installer.

1.运行 TortoiseSVN 安装程序。

2.If you have already installed svn, "Select the option to Modify".

2.如果你已经安装了svn,“选择修改选项”。

3.select the check box"Install Command line client tools on to the local harddrive". enter image description here

3.选中“将命令行客户端工具安装到本地硬盘”复选框在此处输入图片说明

4.Add C:\Program Files\TortoiseSVN\bin to your Path environment variable or press CTRL+ALT+S in android studio. Then go to "Version Control"-> Subversion -> General -> Check the Checkbox "use commmand line client" and set the path to C:\Program Files\TortoiseSVN\bin\svn.exe

4.将 C:\Program Files\TortoiseSVN\bin 添加到您的 Path 环境变量或在 android studio 中按 CTRL+ALT+S。然后转到“版本控制”-> Subversion -> 常规-> 选中复选框“使用命令行客户端”并将路径设置为C:\Program Files\TortoiseSVN\bin\svn.exe

5.Restart IntelliJ.

5.重启IntelliJ。

In Android studio1.5 version when you try to add the file in your project,
android studio will ask for a pop like "schedule for Addition"
to subversion?. select the check box (Remember, don't ask again) and click "yes". 
After this whatever the file you add or remove to your project it will automatically
synced to your svn repository. suppose if you didn't get that dialog, but you want to
add the newly added .png or xml file to svn means you can manually select those files 
which you have added (the newly added file will be in red color) right click 
on that file -> subversion -> Add to VCS or simply select the file and use (CTRL+ALT+A).

In the image green color(logo_actionbar) represents to file was already added to svn, red represents yet to add in svn. cool..!

图中绿色(logo_actionbar)表示文件已经添加到svn,红色表示还没有添加到svn。凉爽的..!

If you want to change the "Schedule for Addition" setting means, Go to Settings-> Version Control-> Confirmation-> When files are created
Choose Show options before adding to version control

如果要更改“添加计划”设置方式,请转到设置->版本控制->确认->创建文件时
选择添加到版本控制之前的显示选项

enter image description hereenter image description here

在此处输入图片说明在此处输入图片说明

回答by Engine

I use the IDE Phpstorm,but I think it maybe the same as AS.

我使用 IDE Phpstorm,但我认为它可能与 AS 相同。

1.You should reinstall the svn. And choose option modify. enter image description here

1.您应该重新安装svn。并选择选项修改在此处输入图片说明

And next step,you can see the command line client tools.

下一步,您可以看到命令行客户端工具

Let's choose first one: Will be installed on local hard drive. enter image description here

让我们选择第一个:将安装在本地硬盘上在此处输入图片说明

2.Now restart you computer.

2.现在重启你的电脑。

Go to the svn location,all the time it will be C:\Program Files\TortoiseSVN\bin.

转到 svn 位置,它始终是C:\Program Files\TortoiseSVN\bin

If you see the svn.exein C:\Program Files\TortoiseSVN\bin,it proved that we reinstall command line client successfully. Copy C:\Program Files\TortoiseSVN\bin\svn.exeinto the IDE.

如果svn.exe在 C:\Program Files\TortoiseSVN\bin 中看到,则证明我们重新安装了命令行客户端成功。复制C:\Program Files\TortoiseSVN\bin\svn.exe到IDE中。

enter image description here

在此处输入图片说明

3.Restart you IDE.It is ok!

3.重启你的IDE,没问题!

回答by NullPointerException

If you are using ubuntu, check weather subversion is installed or not.

如果您使用的是 ubuntu,请检查是否安装了 weather subversion。

If not then install through command line as

如果没有,则通过命令行安装为

sudo apt-get install subversion

and check following configurations are selected

并检查选择了以下配置

enter image description here

在此处输入图片说明

回答by Deepak Kumar Sharma

I have fixed the issue after upgrading existing svn client on mac OS X with following link:(1.7.x to 1.9.x)

在使用以下链接升级 mac OS X 上现有的 svn 客户端后,我已修复该问题:(1.7.x 到 1.9.x)

https://ahmadawais.com/installing-svn-subversion-on-yosemite-after-removing-the-old-version/

https://ahmadawais.com/installing-svn-subversion-on-yosemite-after-removing-the-old-version/

  1. Open Android Studio
  2. Go to Settings -> Version Control -> Subversion -> General -> User command line client ( Marked checkbox)
  1. 打开安卓工作室
  2. 转到设置 -> 版本控制 -> Subversion -> 常规 -> 用户命令行客户端(标记复选框)

replace ‘svn' with your svn installed path like ‘/usr/local/bin/svn'

用你的 svn 安装路径替换 'svn',如 '/usr/local/bin/svn'

回答by virat

i have fixed the issue by just downloading the android command line tool from https://www.visualsvn.com/downloads/download apache comand line tool unzip it on drive go to your android settings/version control/subversion and make sure only command line option is enable set the path of svn.exe as shown below C:\Users\viratsinh.parmar\Apace SVN client\Apache-Subversion-1.8.13\bin\svn.exe

我已经通过从https://www.visualsvn.com/downloads/下载android 命令行工具解决了这个问题, 下载 apache 命令行工具在驱动器上解压缩它去你的 android 设置/版本控制/subversion 并确保只有命令line option is enable 设置svn.exe的路径如下图C:\Users\viratsinh.parmar\Apace SVN client\Apache-Subversion-1.8.13\bin\svn.exe

now in your android studio update the project , you will be able to commit now. you can contact me on [email protected]

现在在您的 android studio 中更新项目,您现在就可以提交了。您可以通过 [email protected] 与我联系

回答by Nadeem Bhat

i was also getting the same Error, if you are using TortoiseSVN-1.9.5 just do two step Process 1:Click on TSVN.exe tool and 2:Select there on Second Window the Command line for Save on Local Drive with giving the path 3:Click ok Now Restart You Android Studio/IntelliJ

我也遇到了同样的错误,如果您使用的是 TortoiseSVN-1.9.5,只需执行两步 过程 1:单击 TSVN.exe 工具,然后 2:在第二个窗口中选择用于在本地驱动器上保存的命令行并提供路径3:点击确定现在重启你的Android Studio/IntelliJ

回答by Cedric Simon

Under Linux, got same problem after Android Studio update (and several months without using it...).

在 Linux 下,Android Studio 更新后遇到了同样的问题(几个月没有使用它......)。

I solved it by running the following command in a console:

我通过在控制台中运行以下命令来解决它:

mv .subversion/ .subversion.bak

I prefer that command to rm -R .subversionsince it left me a rollback option.

我更喜欢这个命令,rm -R .subversion因为它给我留下了一个回滚选项。