Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24021] Hyperloop: Android: require of native class android.content.Intent fails on SDK 6+

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-12T21:12:30.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0, Hyperloop 2.0.0
ComponentsAndroid, Hyperloop
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2016-10-12T19:57:55.000+0000
Updated2016-10-20T22:28:15.000+0000

Description

Because we're still using legacy style require paths for hyperloop wrappers, we're running into issues with Hyperloop 2.0.0 and SDK 6+, just as we did on iOS in TIMOB-23971

Comments

  1. Christopher Williams 2016-10-12

    To test, try this as your app.js in a hyperloop project:
       var Intent = require('android.content.Intent');
       var Activity = require('android.app.Activity');
       var Uri = require("android.net.Uri");
       
       var win = Ti.UI.createWindow({
           backgroundColor: "#fff"
       });
       
       var btn = Ti.UI.createButton({
           title: "Trigger"
       });
       
       btn.addEventListener("click", openIntent);
       
       win.add(btn);
       win.open();
       
       function openIntent() {
           var activity = new Activity(Ti.Android.currentActivity);
       
           var intent = Ti.Android.createIntent({
               action: Ti.Android.ACTION_VIEW
           });
       
           var nativeIntent = new Intent(intent);
           nativeIntent.setData(Uri.parse("sms://"));
           nativeIntent.putExtra("sms_body", "Hello world!");
       
           activity.startActivity(nativeIntent);
       }
       
       
  2. Christopher Williams 2016-10-12

    PR (master): https://github.com/appcelerator/hyperloop.next/pull/86 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/85
  3. Lokesh Choudhary 2016-10-20

    Verified the fix. Require of native class android.content.Intent works as expected. Closing. Appc Studio : 4.8.0.201610171310 Mac OS Version : 10.11.6 Xcode Version : Xcode 8.0 Build version 8A218a Appc CLI AND Appc NPM : {"NPM":"4.2.8-9","CLI":"6.0.0-62"} Ti CLI : 5.0.10 Alloy : 1.9.3 Node : v4.6.0 SDK Version : 6.0.0.v20161019091022 Environment: preprod

JSON Source