[TIMOB-14997] (3_1_X) Target the correct layer

Partial backport of PR #4638

Test is in [JIRA](https://jira.appcelerator.org/browse/TIMOB-14997)