[TIMOB-24151] Hyperloop: Android - requiring certain classes throws an error
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-08T07:19:03.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Hyperloop 2.2.0 |
Components | Hyperloop |
Labels | android |
Reporter | pstueven |
Assignee | Jan Vennemann |
Created | 2016-11-15T08:11:51.000+0000 |
Updated | 2017-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
File | Date | Size |
cmd_log.txt | 2016-11-16T08:13:48.000+0000 | 48926 |
NT.zip | 2016-11-16T08:13:44.000+0000 | 1247233 |
Can you please attach the used library and a complete test-case here? Thx!
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
Same occurring for
android.provider.MediaStore.Images.Media
, reported on Slack. /cc [~cwilliams]PR: https://github.com/appcelerator/hyperloop.next/pull/190
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