Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24151] Hyperloop: Android - requiring certain classes throws an error

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-08-08T07:19:03.000+0000
Affected Version/sn/a
Fix Version/sHyperloop 2.2.0
ComponentsHyperloop
Labelsandroid
Reporterpstueven
AssigneeJan Vennemann
Created2016-11-15T08:11:51.000+0000
Updated2017-09-29T18:28:33.000+0000

Description

There is an error trying to require e.g. GoogleApiClient from Google Play Services [TRACE] [Hyperloop] JS Wrapper for class com.google.android.gms.common.api.Api$zzh created... [TRACE] [Hyperloop] JS Wrapper for class com.google.android.gms.common.api.Batch created... C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\node_modules\async\lib\async.js:319 iterator(obj[key], key, only_once(function (err) { ^ TypeError: packageArray.push is not a function at C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\hooks\android\metabase\generate.js:202:16 at C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\node_modules\async\lib\async.js:181:20 at replenish (C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\node_modules\async\lib\async.js:319:21) at C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\node_modules\async\lib\async.js:326:29 at C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\node_modules\async\lib\async.js:44:16 at C:\ProgramData\Titanium\plugins\hyperloop\1.2.8\hooks\android\metabase\generate.js:219:5 at C:\ProgramData\Titanium\mobilesdk\win32\5.5.1.GA\node_modules\graceful-fs\graceful-fs.js:43:10 at FSReqWrap.oncomplete (fs.js:82:15) Reproduce: Create a sample alloy project with hyperloop enabled for android Insert play-services-base-9.8.0.aar and play-services-basement-9.8.0.aar from android sdk repository in app/platform/android Insert "var Api = require("com.google.android.gms.common.api.GoogleApiClient");" in index.js Build Additional info: "var ConnectionResult = require("com.google.android.gms.common.ConnectionResult");" for example throws no error

Attachments

FileDateSize
cmd_log.txt2016-11-16T08:13:48.000+000048926
NT.zip2016-11-16T08:13:44.000+00001247233

Comments

  1. Hans Knöchel 2016-11-15

    Can you please attach the used library and a complete test-case here? Thx!
  2. pstueven 2016-11-16

    NT.zip contains the changed app/controllers/index.js and the libraries in platform/android cmd_log.txt contains the complete output during the build process
  3. Hans Knöchel 2016-11-16

    Same occurring for android.provider.MediaStore.Images.Media, reported on Slack. /cc [~cwilliams]
  4. Jan Vennemann 2017-06-29

    PR: https://github.com/appcelerator/hyperloop.next/pull/190
  5. Lokesh Choudhary 2017-09-29

    Verified the fix. Requiring classes from the attached test app does not throw errors. Closing. Studio Ver: 4.10.0.201709271713 SDK Ver: 6.2.2.GA OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.4 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.14 Node Ver: 7.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Pixel --- Android 7.1.1 Hyperloop: 2.2.0 RC2

JSON Source