function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Forcedroid create error

I'm trying to go through "Trailhead Native Android" and I'm getting stuck in the first chapter on "forcedroid create". the error I'm getting after i enter the output directory and the error even appears when i leave it blank.
error i am getting from the command line is
"forcedroid create failed
Command failed: git clone --branch v5.0.0 --single-branch --depth 1 --recurse-submodules C:\Users\Owner\Documents\Android project\tmp84510\SalesforceMobileSDK-Templates 
'git' is not recognized as an internal or external command,
operable program or batch file."

NagendraNagendra (Salesforce Developers) 
Hi Abbas,

Force droid is the package for Android installation. Salesforce publishes a Node Packaged Module (npm) package to help you create Mobile SDK apps and you use the npm script to install Mobile SDK and to create projects.

Your best bet here is to follow the steps provided by Salesforce for installing Node.js to use the Mobile SDK npm installers. Once you have that installed you can go ahead and install the force droid utility as follows.

Mac OS X (or other non-Windows environments)—In a terminal window, type:
sudo npm install forcedroid -g
Windows—At the Windows command prompt, type:
npm install forcedroid -g
Once complete, you can create your Android project.


Hi Nagendra,

I followed the steps as it is as they were mentioned by the SalesForce but still getting the same error.
And even intstalled "git" into the system but did not helped me much.

Please help me through this.

Michele Losch 4Michele Losch 4
I'm receiving the same error. Any solution?
mukesh guptamukesh gupta
I am facing same problem. Please suggest , I have spend my 1 week to create hybrid mobile App according to TrailHead ,but facing  issue

forcedroid create failed
Command failed: git clone --branch v5.0.0 --single-branch --depth 1 --recurse-submodules

is TrailHead is wrong?

Any salesforce Experts That's resolve this issue.

Try changing the directory to any other directory.
like D:or E:
n directly type forcedroid create
no need to install all packages again

It helped me and my issue got solved.


Santosh Anand..Santosh Anand..
Try to install git
Pratik PawarPratik Pawar
I'm also getting stuck with this error.

I've tried to change the directory but it's not working for me.

I thought this error occuring due to the link from system trying to clone project repo

in above link system assuming .git(Extetion of the link) as a command. 

can anyone able to resolve/guide this issue?
Pratik PawarPratik Pawar
@Santosh Anand Thank you. after installing git problem has been resolved.
I tried the link to install git but get took too long to respond. Any assistance would be appreciated, thanks.
Samir MouradSamir Mourad
Hi people,

I had the same problem, but after I've installed GIT I solved the problem.

Tip for win users (like me): run the command "forcedroid create" in gitbash command line, not windows command line. It will works :)

Summer Armitage 5Summer Armitage 5
Samir's suggestion worked. Use the gitbash command line.