CreateProcess error = 2, the system cannot find the file specified error

Raghav

I have Android Studio 2.3.3 on Windows and also Git for Windows. I cloned a repository from GitHub ( VCS->Checkout from version control->Git->pasted the link ) and tried to run it. But the gradle sync failed giving this error

CreateProcess error=2, the system cannot find the file specified  

I checked the log and I noticed this

java.io.IOException: Cannot run program "git" (in directory "H:\GitClone\apps-android-commons\app"): CreateProcess error=2, The system cannot find the file specified

The path given is the location I chose during checkout.
I tried changing the path for git.exe from ...\bin\git.exe to ...\cmd\git.exe in Android Studio.
I also added the path for git.exe to my environment PATH variables but the error has persisted.
Other answers on SO mostly tell to do these steps but as I had already done these I had to ask a new question.
Also, my friend advised me to install Github Desktop but I cannot because I have a 32 bit OS.
Note- I am completely new to version control.
Edit - A part of the log

Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'git''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:220)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:204)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:340)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
at org.gradle.internal.operations.BuildOperationIdentifierPreservingRunnable.run(BuildOperationIdentifierPreservingRunnable.java:39)
... 3 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'git'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
... 4 more
VonC

Make sure how you add git.exe to your PATH: while in Android studio yo need to specify the full path including git.exe, you would need to add only the parent folder of git.exe in your PATH:

set PATH=C:\path\to\Git\bin;%PATH%

C:\path\to\Git can be any folder where you uncompressed the sef-extracted archive PortableGit-2.15.1-64-bit.7z.exe.

That needs to be done in your USER Environment variables, and you need to close and re-open Android Studio if you want any process (like Gradle) launch from it to inherit your new %PATH% value.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error message: createProcess error=2, The system cannot find the file specified

CreateProcess error=2, The system cannot find the file specified

Blackberry Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified

Error:java: Cannot run program CreateProcess error=2, The system cannot find the file specified

How to fix "CreateProcess error=2, The system cannot find the file specified" even if the Path variable is specified (crossplatform)

Error:Failed to complete Gradle execution. Cause: CreateProcess error=2, The system cannot find the file specified

java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified

IntelliJ - Cannot run program java.exe. CreateProcess error=2. The system cannot find the file specified

Maven - exec-maven-plugin - CreateProcess error=2, The system cannot find the file specified

Air-Adb: Error "Cannot run program "bash.exe": CreateProcess error=2, The system cannot find the file specified)

AppStartError: CreateProcess: The system cannot find the file specified

Gluonfx build using docker fails, with error: Cannot run program "ie4uinit": CreateProcess error=2, The system cannot find the file specified

pytesseract,WindowsError: [Error 2] The system cannot find the file specified

WindowsError: [Error2] The system cannot find the file specified

I get the error :[WinError 2] The system cannot find the file specified:

Pyper error: [WinError 2] The system cannot find the file specified

Makefile error (e=2): The system cannot find the file specified

Subprocess The system cannot find the file specified Error

Makefile: CreateProcess(...) failed. The system cannot find the file specified

Flutter: Error: Error when reading '-': The system cannot find the file specified

SQL Server on Ubuntu 18.04 Operating system error 2(The system cannot find the file specified.)

WindowsError: [Error 2] The system cannot find the file specified, cannot resolve in Python

rename file in Python: WindowsError: [Error 2] The system cannot find the file specified

Python 3 - os.startfile() - WindowsError: [Error 2] The system cannot find the file specified: 'file_name'

The system cannot find the file specified windows error python

printf in nodejs execSync gives error - the system cannot find the file specified

The System cannot find the file specified error while deleting folder

"The system cannot find the file specified" error on process.Start();

Sublime Text: "The system cannot find the file specified" error