Skip to content

Commit 42cc21e

Browse files
HazemKhaledewanharris
authored andcommitted
fix: Remove unnecessary warning message with iOS (#810)
* Remove unnecessary warning message with iOS On iOS compiling we get warning "Additional views in null only supported on Android" with code ```xml <AlertDialog id="confirmAlertDialog"> <View platform="android"> <Label>Android only!!</Label> </View> </AlertDialog> ``` * fix: only warn if platform is not restricted to just android * docs(changelog): add changelog entry
1 parent e49fa1d commit 42cc21e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Alloy/commands/compile/parsers/Alloy.Abstract._ItemContainer.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,17 @@ function parse(node, state, args) {
7171
}
7272
});
7373
code += androidView;
74-
} else {
75-
logger.warn('Additional views in ' + theNode + ' only supported on Android');
74+
} else if (child.getAttribute('platform') !== 'android') {
75+
var currentPlatform = child.getAttribute('platform');
76+
var warningLog = [
77+
'Additional views in <' + node.nodeName + '> (line ' + node.lineNumber + ') are only supported on Android',
78+
];
79+
if (!currentPlatform) {
80+
warningLog.push('To get rid of this warning, add platform="android" to your child elements');
81+
} else {
82+
warningLog.push('To get rid of this warning, remove any other platforms from your child elements');
83+
}
84+
logger.warn(warningLog);
7685
}
7786
} else {
7887
U.die(theNode + ' can only have one androidView');

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#### Fixes
1616

17+
* [ALOY-1535](https://jira.appcelerator.org/browse/ALOY-1535) Only warn when using an AlertDialog with child views not restricted to Android
18+
1719
### Release 1.13.9
1820

1921
#### Fixes

0 commit comments

Comments
 (0)