Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23179] Hyperloop: Android - Java primitives arrays are wrapped in hyperloop proxies improperly

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-04-13T11:27:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsAndroid, Hyperloop
Labelsandroid, hyperloop
ReporterChristopher Williams
AssigneeChristopher Williams
Created2016-04-08T18:00:46.000+0000
Updated2016-07-20T22:27:44.000+0000

Description

This fails:
var Build = require('android.os.Build');
Build.SUPPORTED_ABIS[0];
The error reported says something about being unable to require a model, with a name of something like L[String@ergsdgf; Basically, it looks like we're wrapping this primitive String array in a hyperloop proxy, rather than just letting the bridge handle the conversion for us. Right now our code to determine when to wrap isn't specific enough to allow this to pass through:
return item == null || item instanceof KrollProxy || item instanceof Integer
                || item instanceof Double || item instanceof Float
                || item instanceof Byte || item instanceof Short
                || item instanceof Long || item instanceof HashMap
                || item instanceof String || item instanceof Boolean || item instanceof Date;

Comments

  1. Lokesh Choudhary 2016-07-20

    Verified the fix.
       var Build = require('android.os.Build');
       Build.SUPPORTED_ABIS[0];
       
    does not fail & logging in gives armeabi-v7a Closing. Environment: Appc Studio : 4.7.0.201607111053 Ti SDK : 5.4.0.v20160720132422 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.5 Appc NPM : 4.2.8-1 Appc CLI : 5.4.0-33 Node: 4.4.4 Nexus 5 - Android 6.0.1

JSON Source