Get Started         Best Practices         Developer Guide         FAQ        
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Error installing cordova plugin using cordova

Stijn Dec 14, 2017

Hi,

I'm trying to install the CatchAR plugin in my Cordova workflow as described in the documentation. But unfortunately when running command ('cordova plugin add craftar-cordova-cloud-image-recognition --nofetch') it is giving me an failure:

Error: "Hook failed with error code 1"

This error is appearing when installing the craftar-cordova-sdk-ar (or any of the other cordova AR plugins). I don't know why the hooks in this plugin are failing. I tried to to manually place the files of the craftar-cordova-sdk-ar in the plugin folder by downloading and copying the zip but also without result.

Am i missing something? I'm sure correctly followed all the steps in the documentation.


( Agent )
Luis Martinell

Dec 15, 2017

Hi Stijn,

Are you working on Linux or windows? Can you share the full logs and run in verbose (-d) mode?

Thanks!
Luis

0 rated
Stijn

Dec 19, 2017

Hi Luis,

I'm working on Windows. Also i'm not quite familiar with starting in verbose mode. How is that going to solve my problem?
I tried adding 'loglevel=verbose' in my npm config. However, below is my log/output from cmd.

Thanks for your help!

Grtz,
Stijn


D:\Vagrantboxen\{{___PROJECT___}}>cordova plugin add craftar-cordova-on-device-image-recognition
Installing "craftar-cordova-on-device-image-recognition" for android
Plugin dependency "craftar-cordova-core@1.0.0" already fetched, using that version.
Dependent plugin "craftar-cordova-core" already installed on android.
Plugin dependency "craftar-cordova-sdk-odir@1.0.0" already fetched, using that version.
Installing "craftar-cordova-sdk-odir" for android
Running command: cmd "/s /c "sh D:\Vagrantboxen\{{___PROJECT___}}\plugins\craftar-cordova-sdk-odir\hooks\before_plugin_install\install_android_sdk.sh D:\Vagrantboxen\{{___PROJECT___}}""
'sh' is not recognized as an internal or external command,
operable program or batch file.
Failed to install 'craftar-cordova-sdk-odir': Error: Hook failed with error code 1: D:\Vagrantboxen\{{___PROJECT___}}\plugins\craftar-cordova-sdk-odir\hooks\before_plugin_install\install_android_sdk.sh at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:231:23
at _rejected (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:864:24)
at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:890:30
at Promise.when (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:808:41)
at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:624:44
at runSingle (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:137:13)
at flush (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
Failed to install 'craftar-cordova-on-device-image-recognition': Error: Hook failed with error code 1: D:\Vagrantboxen\{{___PROJECT___}}\plugins\craftar-cordova-sdk-odir\hooks\before_plugin_install\install_android_sdk.sh
at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:231:23
at _rejected (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:864:24)
at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:890:30
at Promise.when (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:808:41)
at C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:624:44
at runSingle (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:137:13)
at flush (C:\Users\{{___USER___}}\AppData\Roaming\nvm\v7.8.0\node_modules\cordova\node_modules\cordova-common\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
Error: Hook failed with error code 1: D:\Vagrantboxen\{{___PROJECT___}}\plugins\craftar-cordova-sdk-odir\hooks\before_plugin_install\install_android_sdk.sh
0 rated
( Agent )
Luis Martinell

Dec 19, 2017

Hi Stijn,

The problem is that we use sh scripts for managing the installation of the CraftAR native SDKs into the cordova project. This is only supported on Linux and Mac OS X.

Can you use the cordova cli through cygwin or some bash compatible command line interpreter on windows?

Best regards,
Luis

0 rated

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Couldn't find what you were looking for?

support@catchoom.com
https://cdn.desk.com/
false
catchoom
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete