From b3b7a939bc7bb742ea17251c3620b05fc5b0b7c6 Mon Sep 17 00:00:00 2001 From: Richard Windley Date: Fri, 6 Apr 2018 11:18:22 +0100 Subject: [PATCH] Amend check for cordova-android 7 --- README.MD | 3 +++ package.json | 2 +- plugin.xml | 2 +- scripts/lib/utilities.js | 16 ++++++++-------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.MD b/README.MD index 1156b8f..4f2c001 100644 --- a/README.MD +++ b/README.MD @@ -21,6 +21,9 @@ AndroidManifest.xml is automatically updated to use the new MainActivity. Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments) # History +## 0.0.6 +- Fix stupid cordova-android 7 detection + ## 0.0.5 - Attempt to avoid crash only seen on Galaxy J1 Ace (5.1.1) diff --git a/package.json b/package.json index 5b9f386..a4cb30c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-android-fragmentactivity", - "version": "0.0.5", + "version": "0.0.6", "description": "An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview.", "cordova": { "id": "cordova-plugin-android-fragmentactivity", diff --git a/plugin.xml b/plugin.xml index 3203dd3..3e2360f 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + Cordova Android FragmentActivity Plugin An android plugin that provides a replacement activity to the default activity to start a cordova application with MainActivity as a Fragment Activity. Useful when you want to add native views on top of cordova webview. diff --git a/scripts/lib/utilities.js b/scripts/lib/utilities.js index 46ff72b..edd4736 100644 --- a/scripts/lib/utilities.js +++ b/scripts/lib/utilities.js @@ -14,19 +14,19 @@ module.exports = { return null; } - var androidPath = context.opts.projectRoot + '/platforms/android'; + var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main'; if (!fs.existsSync(androidPath)) { - androidPath = context.opts.projectRoot + '/platforms/android/app/src/main'; + androidPath = context.opts.projectRoot + '/platforms/android'; if (!fs.existsSync(androidPath)) { console.log("Unable to detect type of cordova-android application structure"); throw new Error("Unable to detect type of cordova-android application structure"); } else { - console.log("Detected cordova-android 7 application structure"); + console.log("Detected pre cordova-android 7 application structure"); } } else { - console.log("Detected pre cordova-android 7 application structure"); + console.log("Detected cordova-android 7 application structure"); } return androidPath; @@ -43,19 +43,19 @@ module.exports = { return null; } - var androidPath = context.opts.projectRoot + '/platforms/android/src'; + var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java'; if (!fs.existsSync(androidPath)) { - androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java'; + androidPath = context.opts.projectRoot + '/platforms/android/src'; if (!fs.existsSync(androidPath)) { console.log("Unable to detect type of cordova-android application structure"); throw new Error("Unable to detect type of cordova-android application structure"); } else { - console.log("Detected cordova-android 7 application structure"); + console.log("Detected pre cordova-android 7 application structure"); } } else { - console.log("Detected pre cordova-android 7 application structure"); + console.log("Detected cordova-android 7 application structure"); } return androidPath;