Skip to content

Commit b3b7a93

Browse files
Amend check for cordova-android 7
1 parent 4676bfc commit b3b7a93

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

README.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ AndroidManifest.xml is automatically updated to use the new MainActivity.
2121
Based on cordova-android-fragments (https://github.com/rajivnarayana/CordovaFragments)
2222

2323
# History
24+
## 0.0.6
25+
- Fix stupid cordova-android 7 detection
26+
2427
## 0.0.5
2528
- Attempt to avoid crash only seen on Galaxy J1 Ace (5.1.1)
2629

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordova-plugin-android-fragmentactivity",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"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.",
55
"cordova": {
66
"id": "cordova-plugin-android-fragmentactivity",

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.5">
2+
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-android-fragmentactivity" version="0.0.6">
33

44
<name>Cordova Android FragmentActivity Plugin</name>
55
<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.</description>

scripts/lib/utilities.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ module.exports = {
1414
return null;
1515
}
1616

17-
var androidPath = context.opts.projectRoot + '/platforms/android';
17+
var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main';
1818

1919
if (!fs.existsSync(androidPath)) {
20-
androidPath = context.opts.projectRoot + '/platforms/android/app/src/main';
20+
androidPath = context.opts.projectRoot + '/platforms/android';
2121

2222
if (!fs.existsSync(androidPath)) {
2323
console.log("Unable to detect type of cordova-android application structure");
2424
throw new Error("Unable to detect type of cordova-android application structure");
2525
} else {
26-
console.log("Detected cordova-android 7 application structure");
26+
console.log("Detected pre cordova-android 7 application structure");
2727
}
2828
} else {
29-
console.log("Detected pre cordova-android 7 application structure");
29+
console.log("Detected cordova-android 7 application structure");
3030
}
3131

3232
return androidPath;
@@ -43,19 +43,19 @@ module.exports = {
4343
return null;
4444
}
4545

46-
var androidPath = context.opts.projectRoot + '/platforms/android/src';
46+
var androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java';
4747

4848
if (!fs.existsSync(androidPath)) {
49-
androidPath = context.opts.projectRoot + '/platforms/android/app/src/main/java';
49+
androidPath = context.opts.projectRoot + '/platforms/android/src';
5050

5151
if (!fs.existsSync(androidPath)) {
5252
console.log("Unable to detect type of cordova-android application structure");
5353
throw new Error("Unable to detect type of cordova-android application structure");
5454
} else {
55-
console.log("Detected cordova-android 7 application structure");
55+
console.log("Detected pre cordova-android 7 application structure");
5656
}
5757
} else {
58-
console.log("Detected pre cordova-android 7 application structure");
58+
console.log("Detected cordova-android 7 application structure");
5959
}
6060

6161
return androidPath;

0 commit comments

Comments
 (0)