1

How can I connect a project in Android Studio 3.0 with TFS(Team Foundation Server) 2017? I tried this link,but I can't successfully connect to TFS 2017. I need to connect with Team foundation Server and not with the Team Service.How can I check in my Android studio project into TFS (For the first time)?

rangarajb2005
  • 51
  • 1
  • 7
  • What's the error message? – Muhammad Hannan Oct 30 '17 at 12:28
  • This is the Error message : Error:An argument error occurred: Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'. It's successfully connected with TFS,but I can't add a new project into TFS. – rangarajb2005 Oct 31 '17 at 03:55

1 Answers1

2

I can reproduce the issue, the problem is you are trying to add an existing project which is not located in the workspace to source control.

Please following below steps to add a new (existing) project into TFS:

  1. Make sure you have correctly configured the TFVC for Android studio. See TFVC Setup Requirements for TFVC support.
  2. Open Android Studio and select VCS > Check out from Version Control > Team Services TFVC > Switch to Team Foundataion Server tab > Add TFS server URL > Connect... > Select the team project which you want to use > Specify local directory and Create Workspace
  3. Copy the existing Android prject to the new workspace local directory
  4. Open the copied project in Android Studio: File > Open > navigate to the workspace to open the copied project
  5. Right click on the Root project > TFVC > Checkin Directory or VCS > Commit changes.

Another way is creating a new project when the project checed out, the system will popup a dialog to ask if you want to create a new project, just click YES. Thus, the new project will be added to source control automaticaly.

You can also reference this similar thread: Add existing Android Studio project to VSTS

enter image description here


UPDATE: Catpured the steps to add existhing project to scoure control:

As the image is too large to upload (over 2 MiB), I posted in OneDrive, access it via this link : https://onedrive.live.com/?authkey=%21AAfH5DQow7FJgPg&cid=01C8C96A530FEA6E&id=1C8C96A530FEA6E%212296&parId=1C8C96A530FEA6E%211833&o=OneUp

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • Thanks andy-MSFT: I tried given solution, but AS showed a message "No Changes Detected" when i tried to commit the project as shown in your screenshot – rangarajb2005 Oct 31 '17 at 10:22
  • @rangarajb2005 Make sure you have copied the existing project to the workspace and opened the copied project. Whatever I have captured the steps with a gif file, you can follow the steps to do that. Just see the updated answer. BTW If that works for you , you could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), This can be beneficial to other community members reading this thread. – Andy Li-MSFT Nov 01 '17 at 04:57
  • Andy-MSFT - I got following error message when I tried to checkout a file? Do you have any idea about this error. Error message : Error:TF400022: The item $/Version Control App/MyApplication1/app/src/main/java/com/example/rangarajb/myapplication1/MainActivity.java cannot be locked for checkout in workspace Version;TryOuttfs i. t. Checkout locks are not supported in local workspaces. – rangarajb2005 Nov 01 '17 at 08:50
  • @rangarajb2005 I suggest you post a new thread for the new question, then we can track the question there. As the rule one thread one question, this can be beneficial to other community members reading this thread and also benefit for you to get the answer timely. – Andy Li-MSFT Nov 01 '17 at 09:01