Android Studio Checkout Github Error "CreateProcess=2" (Windows)
GithubAndroid StudioGithub Problem Overview
Today I've tried to checkout my Github project using brand new Android Studio and ended up with this nasty error :
Why things just never work out of the box ...?
Github Solutions
Solution 1 - Github
I've solved the problem , and I will explain how :
- Download Github For Windows client and install it.
- After The client successfully installed , connect it with your github account.It should be easy , just follow the wizard.
- Then you should add git.exe location to your "Path Variable". The location you should add will probably be something like : C:\Users\Your_Username\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\bin
Alternatively , if you don't want to add to environment variables. You can open the android studio and go to : Settings -> Version Control -> Git In text box next to "Path to Git Executable" you will see "git.exe" , just give it a full path like so : C:\Users\Your_Username\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\bin\git.exe
EDIT : For latest Github for windows versions some can find the git.exe under "...\cmd\git.exe" rather than "...\bin\git.exe".
Solution 2 - Github
I found what I think is a faster solution. Install Git for Windows from here: http://git-scm.com/download/win
That automatically adds its path to the system variable during installation if you tell the installer to do so (it asks for that). So you don't have to edit anything manually.
Just close and restart Android Studio if it's open and you're ready to go.
Solution 3 - Github
I am using Windows 10 OS and GitHub Desktop version 1.0.9.
For the new Github For Windows, git.exe is present in the below location.
%LOCALAPPDATA%\GitHubDesktop\app-[gitdesktop-version]\resources\app\git\cmd\git.exe
Example:
%LOCALAPPDATA%\GitHubDesktop\app-1.0.9\resources\app\git\cmd
Solution 4 - Github
If you have downloaded Github Desktop Client 1.0.9
then the path for git.exe
will be
> C:\Users\Username\AppData\Local\GitHubDesktop\app-1.0.9\resources\app\git\cmd\git.exe
Solution 5 - Github
I faced same issue in android studio 3.2.1, solved the issue by setting git path in System Environment variable
> C:\Program Files\Git\bin,C:\Program Files\Git\bin\
And I imported the project once again and solved the issue!!!
Note : Check your android studio git settings has properly set the correct path to git.exe
Solution 6 - Github
Steps:
-
Download git for windows https://git-scm.com/downloads
-
Install downloaded git with default setup
-
From Android Studio close if any project is open then Click on Configure -> Settings -> Version Control -> Git
>4) Change Path to Git executable : git.exe to C:\Program Files\Git\cmd\git.exe
-
Apply and Ok
-
Try to clone from Check out project from Version Control
-
Done
Solution 7 - Github
for Android Studio 3.0.1, you can config GitHub path for following path:
- File > Setting > Version Control
- List item
- Click "+" on the top-right conor to open "Add VCS Directory Mapping"
- Click "Configure VCS" to open "Version Control Configurations"
- Click "Git" then you'll see Path to Git executable]
- Input : C:\Users[you user name]\AppData\Local\GitHub\PortableGit_d7effa1a4a322478cd29c826b52a0c118ad3db11\cmd\git.exe
- Test it
Solution 8 - Github
I encountered a similar error with RubyMine 2016.3 recently, wherein any attempts at checkout or export to Github were met with "Cannot run program 'C:\Program Files (x86)\Git\cmd\git.exe': CreateProcess error=2, The system cannot find the file specified"
As an alternative solution for this problem, other than editing the Path system variable, you can try searching through the program files of Android Studio for a git.xml file and editing the myPathToGit option to match the actual location of git.exe on your computer. This is how I fixed this similar issue in RubyMine.
Posting this solution here for the sake of posterity.
Solution 9 - Github
I had this issue on Mac. I simply quit Android Studio and restarted it, and for some reason had no further issues.