Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6027] Android P 9.0 commonjs module error

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionNeeds more info
Resolution Date2018-12-02T22:20:24.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAlloy
Labelsn/a
ReporterDavid Penney
AssigneeShak Hossain
Created2018-11-20T17:07:48.000+0000
Updated2018-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; };

Comments

  1. Rene Pot 2018-11-22

    Hi! What error are you experiencing exactly?
  2. Rakhi Mitro 2018-11-28

    [~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

JSON Source