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
Keith Price 6Keith Price 6 

Get Started with Hybrid Development - forcedroid create hangs

I am doing the challende for this - got as far as running forcedroid create in GITShell. All seems to go well until it hangs as shown at the end of the Powershell output below - I never get the chance to enter the Callback URL and Consumer Key values. Have no idea how to fix this - it is not finishing the copy of the project ftom the tmp directory, so the www/bootconfig.json file doesn't exist....

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
 
~\Documents\GitHub> forcedroid create
Enter your application type (native, react_native, hybrid_local, hybrid_remote): hybrid_remote
Enter your application name:
Invalid value for application name: ''.
Enter your application name: TrailheadHybridTest
Enter the package name for your app (com.mycompany.myapp): com.trailhead.hybrid
Enter your organization name (Acme, Inc.): Trailhead, Inc.
Enter the start page for your app: HybridPage
Enter output directory for your app (leave empty for the current directory): TrailHybridApps
Invalid value for output directory (directory must not already exist): 'TrailHybridApps'.
Enter output directory for your app (leave empty for the current directory): TrailHybridApps
 
********************************************************************************
*
*   Creating android hybrid_remote application using Salesforce Mobile SDK
*     with app name:        TrailheadHybridTest
*          package name:    com.trailhead.hybrid
*          organization:    Trailhead, Inc.
*
*     in:                   TrailHybridApps
*
*     from template repo:   https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v5.1.0
*          template path:   HybridRemoteTemplate
*          start page:      HybridPage
*          plugin repo:     https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v5.1.0
*
********************************************************************************
 
Creating a new cordova project.
C:\Users\Keith\Documents\GitHub\TrailHybridApps C:\Users\Keith\Documents\GitHub
com.trailhead.hybrid@1.0.0 C:\Users\Keith\Documents\GitHub\TrailHybridApps
`-- shelljs@0.7.0
  +-- glob@7.1.2
  | +-- fs.realpath@1.0.0
  | +-- inflight@1.0.6
  | | `-- wrappy@1.0.2
  | +-- inherits@2.0.3
  | +-- minimatch@3.0.4
  | | `-- brace-expansion@1.1.7
  | |   +-- balanced-match@0.4.2
  | |   `-- concat-map@0.0.1
  | +-- once@1.4.0
  | `-- path-is-absolute@1.0.1
  +-- interpret@1.0.3
  `-- rechoir@0.6.2
    `-- resolve@1.3.3
      `-- path-parse@1.0.5
 
C:\Users\Keith\Documents\GitHub
C:\Users\Keith\Documents\GitHub\TrailHybridApps C:\Users\Keith\Documents\GitHub
Using cordova-fetch for cordova-android@6.1.2
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.trailhead.hybrid
        Name: TrailheadHybridTest
        Activity: MainActivity
        Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.1.2
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
 
               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
 
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~6.1.2 into config.xml file ...
C:\Users\Keith\Documents\GitHub
C:\Users\Keith\Documents\GitHub\TrailHybridApps C:\Users\Keith\Documents\GitHub

 
Keith Price 6Keith Price 6
Update - finally got an error message after many minutes Cant't make much of it so far:

forcedroid failed
 
Command failed: cordova plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v5.1.0 --force
Error: Failed to fetch plugin https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v5.1.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963228 Error output:
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:342:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:497:12)
npm WARN addRemoteGit  git+https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin.git#v5.1.0 resetting remote C:\Users\Keith\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-forcedotcom-SalesforceMobileSDK-CordovaPlugin-git-v5-1-0-33807aab because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:204:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:886:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:342:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:497:12)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! addLocal Could not install C:\Users\Keith\AppData\Local\Temp\npm-11976-95b87faf\git-cache-4f1ff8df\24a997d4581941c692b26bae755b2c5360fff306
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v5.1.0" "--save"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR! syscall read
 
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
 
npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Keith\Documents\GitHub\TrailHybridApps\node_modules\npm-debug.log
 
Keith Price 6Keith Price 6
Hi All
Could someone please respind to this? I feel sure it is not that hard an issue to resolve, and I would like to be able to move forward.
Thanks
Keith
kanav khurana 6kanav khurana 6
Hey Keith,

I'm struggling with this as well. It is really frustrating to get the salesforce SDK to run. Were you able to get around this? Cheers!
Keith Price 6Keith Price 6
Hi Kanav Not so far. I am pretty sure it's a version mismatch of some sort, and there may be some relevant discussion on the forums somewhere (I remember seeing something that may be the answer, but haven't been able to find it again). I'm a little surprised at how little help (i.e. none) is forthcoming on this - people re usually all over these questions. I'll be sure to post if I find something. Cheers Keith
kanav khurana 6kanav khurana 6
Hey Keith,

I was able to get around this issue. Thought I'll update. I tried the following:

a) Downgrade to cordova version 6.4.0. The latest version 7.<something> is not supported by the Salesforce Mobile sdk (I think).
b) Run the following command to increase the Git buffer size:
git config --global http.postBuffer 524288000

Do these two things and then try a fresh 'forcedroid create'. All the best!
Scott WScott W
Had a different error, but I had to set ANDROID_HOME before running forcehybrid create

set ANDROID_HOME=C:\ installation location \android\sdk

https://stackoverflow.com/questions/26356359/error-android-home-is-not-set-and-android-command-not-in-your-path-you-must