Open biesbjerg opened 8 years ago
A bit of debugging reveals that config-file is read correctly:
[{
"_id": 27,
"tag": "config-file",
"attrib": {
"target": "AndroidManifest.xml",
"parent": "/*"
},
"text": "\n ",
"tail": "\n ",
"_children": [{
"_id": 28,
"tag": "supports-screens",
"attrib": {
"android:xlargeScreens": "false",
"android:largeScreens": "false",
"android:smallScreens": "false"
},
"text": "",
"tail": "\n ",
"_children": []
}, {
"_id": 29,
"tag": "uses-permission",
"attrib": {
"android:name": "android.permission.READ_CONTACTS",
"android:maxSdkVersion": "15"
},
"text": "",
"tail": "\n ",
"_children": []
}, {
"_id": 30,
"tag": "uses-permission",
"attrib": {
"android:name": "android.permission.WRITE_CONTACTS"
},
"text": "",
"tail": "\n ",
"_children": []
}]
}]
But for some reason _.keyBy
throws an Error
getConfigFilesByTargetAndParent: function(platform) {
var configFileData = this.getConfigXml().findall('platform[@name=\'' + platform + '\']/config-file');
return _.keyBy(configFileData, function(item) {
Maybe it's the lodash version's fault?
/**
* @license
* lodash 3.10.1 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -d -o ./index.js`
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
I see the cordova-config-utils package depends on lodash@4.14.0, but somehow another (older) version is required
in the hook - any idea how to fix this?
bash-3.2$ npm list lodash
Mindly@ /Users/kim/ionic/MindlyApp
├─┬ cordova-config-utils@2.3.0
│ └── lodash@4.14.0
├─┬ gulp@3.9.1
│ └─┬ vinyl-fs@0.3.14
│ └─┬ glob-watcher@0.0.6
│ └─┬ gaze@0.5.2
│ └─┬ globule@0.1.0
│ └── lodash@1.0.2
├─┬ ionic-angular@2.0.0-beta.10
│ └── lodash@3.10.1
└─┬ ionic-gulp-sass-build@1.0.0
└─┬ gulp-sass@2.3.2
└─┬ node-sass@3.8.0
├─┬ gaze@1.1.0
│ └─┬ globule@1.0.0
│ └── lodash@4.9.0
└─┬ sass-graph@2.1.2
└── lodash@4.14.0
Same issue for me.
This happens if you have an older lodash version as a top-level dependency of your package. Because the hook is copied out of node_modules hierarchy and into hooks it is then requiring the older top-level version of lodash and and not it's own nested dependency.
Not sure how to fix this though. :(
I fix the issue adding a peerDependencies in package.json
"peerDependencies": { "lodash": "^4.16.0" },
hope i help you
I had to use parent="application" instead of "/manifest/application" for whatever reason. I wouldn't have know this without the change in #20 .
I copied the example for adding a
config-file
section for Android into my config.xml and ranionic build ios
Output:
Is it a bug or am I doing something wrong?