[AC-6027] Android P 9.0 commonjs module error
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2018-12-02T22:20:24.000+0000 |
Affected Version/s | Appcelerator Studio 4.5.0 |
Fix Version/s | n/a |
Components | Alloy |
Labels | n/a |
Reporter | David Penney |
Assignee | Shak Hossain |
Created | 2018-11-20T17:07:48.000+0000 |
Updated | 2018-12-02T22:20:25.000+0000 |
Description
Packaging for Android and Testing on Pixel 2 Android P 9.0
In my alloy.js file i've linked to a commonjs file
//alloy.js
var dpi = require('/ui/dpi');
//as this method is call before the index page open it causes the app to not load
Alloy.CFG.borderWidth = dpi.dipUnitsToPixels(6);
//dpi.js
exports.dipUnitsToPixels = function(dipUnits) {
var DENSITY_SMALL_LDPI = 120;
var DENSITY_BASELINE_MDPI = 160;
var DENSITY_HIGH_HDPI = 240;
var DENSITY_EXTRA_HIGH_XHDPI = 320;
var ret;
switch (Ti.Platform.displayCaps.dpi) {
case DENSITY_SMALL_LDPI:
ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_SMALL_LDPI));
break;
case DENSITY_BASELINE_MDPI:
ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_BASELINE_MDPI));
break;
case DENSITY_HIGH_HDPI:
ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_HIGH_HDPI));
break;
case DENSITY_EXTRA_HIGH_XHDPI:
ret = (dipUnits * (Ti.Platform.displayCaps.dpi / DENSITY_EXTRA_HIGH_XHDPI));
break;
default:
ret = dipUnits;
}
return ret;
};
Hi! What error are you experiencing exactly?
[~dpenney], Can you please share more information about the issue you are experiencing? It would be helpful if you provide error logs, screenshot which displays the issue properly. Thanks