Skip to content

Commit 6b742c3

Browse files
committed
Support for new manifest location in cordova-android 7.x
1 parent 9f2e812 commit 6b742c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hooks/lib/android/manifestWriter.js

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Class injects plugin preferences into AndroidManifest.xml file.
33
*/
44

5+
var fs = require('fs');
56
var path = require('path');
67
var xmlHelper = require('../xmlHelper.js');
78

@@ -19,6 +20,11 @@ module.exports = {
1920
*/
2021
function writePreferences(cordovaContext, pluginPreferences) {
2122
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'AndroidManifest.xml');
23+
24+
if (!fs.existsSync(pathToManifest)) {
25+
pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
26+
}
27+
2228
var manifestSource = xmlHelper.readXmlAsJson(pathToManifest);
2329
var cleanManifest;
2430
var updatedManifest;

0 commit comments

Comments
 (0)