apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 209 forks source link

build-app-settings.js fails #45

Closed speigg closed 8 years ago

speigg commented 9 years ago
> node plugins/cordova-plugin-app-preferences/bin/build-app-settings.js
cordova error { [Error: Cannot find module 'cordova/node_modules/cordova-lib/src/cordova/util'] code: 'MODULE_NOT_FOUND' }
module.js:338
    throw err;
          ^
Error: Cannot find module 'plist'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/[...]/plugins/cordova-plugin-app-preferences/bin/build-app-settings.js:34:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
tripodsan commented 9 years ago

you need to cd into the bin folder and execute npm install there. I also needed to do a npm install cordova so that it can resolve the util module.

so:

$ cd plugins/cordova-plugin-app-preferences/bin/
$ npm install
$ npm install cordova
$ cd ../../../

now I get:

$ ./plugins/cordova-plugin-app-preferences/bin/build-app-settings.js
will push strings array {"titles":["English (US)","English (UK)"],"values":["en-us","en-gb"]}
you must insert following xml node into <application> section of your Manifest:
<activity android:name="me.apla.cordova.AppPreferencesActivity"></activity>
ios settings bundle was successfully generated
android preferences file was successfully generated
Segmentation fault: 11
SomaticIT commented 8 years ago

Using #50, Build can be done using Cordova CLI without requiring you to do:

$ cd plugins/cordova-plugin-app-preferences/bin/
$ npm install
$ npm install cordova
$ cd ../../../
$ node plugins/cordova-plugin-app-preferences/bin/build-app-settings.js

but only

$ cordova prepare
apla commented 8 years ago

App settings now (finally!) generated at prepare