Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

fix #133 : Manifest error with cordova 6+ #157

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hooks/lib/android/manifestWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Class injects plugin preferences into AndroidManifest.xml file.

var path = require('path');
var xmlHelper = require('../xmlHelper.js');
var fs = require('fs');

module.exports = {
writePreferences: writePreferences
Expand All @@ -19,6 +20,9 @@ module.exports = {
*/
function writePreferences(cordovaContext, pluginPreferences) {
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'AndroidManifest.xml');
if (!fs.existsSync(pathToManifest)) {
pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
}
var manifestSource = xmlHelper.readXmlAsJson(pathToManifest);
var cleanManifest;
var updatedManifest;
Expand Down