Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24900] Android: Unable to build to Android 8.0 devices or emulators

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-08-10T16:33:02.000+0000
Affected Version/sRelease 6.1.0, Release 6.1.1
Fix Version/sRelease 6.2.0
ComponentsAndroid
Labelsmerge-6.2.0, qe-6.1.1
ReporterJosh Longton
AssigneeGary Mathews
Created2017-06-27T17:29:02.000+0000
Updated2017-08-21T22:24:44.000+0000

Description

Android 8.0 preview is out when trying to build to my device I received the error below.

Steps to reproduce:

Create the default application appc new

Build to an android device running 8.0 appc run -p android -T device -l trace

Actual

{noformat} 2017-06-27T17:02:19.391Z | ERROR | An uncaught exception was thrown! Cannot read property 'cyan' of undefined 2017-06-27T17:02:19.391Z | ERROR | Cannot read property 'cyan' of undefined 2017-06-27T17:02:19.391Z | TRACE | TypeError: Cannot read property 'cyan' of undefined at setDeviceId (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/android/cli/commands/_build.js:1273:61) at AndroidBuilder.validate (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/android/cli/commands/_build.js:1339:8) at Object.exports.validatePlatformOptions (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/titanium.js:672:69) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/cli/commands/build.js:278:21 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/cli/commands/build.js:458:4 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/lib/environ.js:271:4 at ChildProcess.exithandler (child_process.js:195:7) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:886:16) at Socket. (internal/child_process.js:342:11) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at Pipe._handle.close [as _onclose] (net.js:497:12) --------------------------------------------- at Object.exports.execFile (child_process.js:287:9) at exports.exec (child_process.js:103:18) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/lib/environ.js:267:3 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3694:9 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:356:16 at replenish (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:877:25) at iterateeCallback (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:867:17) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:840:16 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3691:13 at apply (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:21:25) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:56:12 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/lib/environ.js:234:7 at ChildProcess.exithandler (child_process.js:195:7) at emitTwo (events.js:106:13) --------------------------------------------- at Object.exports.execFile (child_process.js:287:9) at exports.exec (child_process.js:103:18) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/lib/environ.js:227:6 at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3686:9 at replenish (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:882:17) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:886:9 at eachOfLimit (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:913:22) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:918:16 at _parallel (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3685:5) at Object.series (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:4525:3) at Object.getOSInfo (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/lib/environ.js:223:8) at Function.logger.log.init (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/cli/commands/build.js:429:11) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/cli/commands/build.js:265:15 at CLI.callCommandValidate (/Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/lib/cli.js:720:7) at /Users/Josh/.appcelerator/install/6.2.2/package/node_modules/titanium/node_modules/node-appc/node_modules/async/dist/async.js:3686:9 --------------------------------------------- at Object.run (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:59:8) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:325:21 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3830:24 at eachOfArrayLike (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1003:9) at eachOf (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1051:5) at _parallel (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3829:5) at Object.parallelLimit [as parallel] (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3912:5) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:309:9 at ChildProcess. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:60:3) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:886:16) at Socket. (internal/child_process.js:342:11) --------------------------------------------- at Object.run (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:59:8) at getVMInfo (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:306:18) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:447:4 at Object.detect (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:38:41) at Object.isEmulator (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:445:7) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulator.js:188:13 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3830:24 at eachOfArrayLike (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1003:9) at eachOf (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1051:5) at _parallel (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3829:5) at Object.parallelLimit [as parallel] (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3912:5) at EmulatorManager.isEmulator (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulator.js:182:8) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:391:12 at conn.exec.bufferUntilClose (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:493:5) at Connection. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:252:4) --------------------------------------------- at Socket.Readable.on (_stream_readable.js:687:35) at Connection.exec (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:249:9) at ADB. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:492:9) at Connection. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:172:8) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:176:18) at Socket.Readable.push (_stream_readable.js:134:10) at TCP.onread (net.js:547:20) --------------------------------------------- at Socket.Readable.on (_stream_readable.js:687:35) at Connection.exec (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:120:9) at ADB.shell (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:488:7) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:352:8 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3830:24 at replenish (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:946:17) at iterateeCallback (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:931:17) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:906:16 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3835:13 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/adb.js:393:6 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulator.js:198:4 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3838:9 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:421:16 at iteratorCallback (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:998:13) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:906:16 --------------------------------------------- at Object.run (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:59:8) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:325:21 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3830:24 at eachOfArrayLike (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1003:9) at eachOf (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:1051:5) at _parallel (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3829:5) at Object.parallelLimit [as parallel] (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3912:5) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:309:9 at ChildProcess. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:60:3) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:886:16) at Socket. (internal/child_process.js:342:11) --------------------------------------------- at Object.run (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:59:8) at getVMInfo (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:306:18) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:447:4 at finalize (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:179:4) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:234:6 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:386:4 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3838:9 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:421:16 at iteratorCallback (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:998:13) at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:906:16 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/node_modules/async/dist/async.js:3835:13 at /Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-titanium-sdk/lib/emulators/genymotion.js:381:7 at ChildProcess. (/Users/Josh/Library/Application Support/Titanium/mobilesdk/osx/6.1.1.v20170626160851/node_modules/node-appc/lib/subprocess.js:60:3) at emitTwo (events.js:106:13) {noformat}

Expected

No error is shown and the build is successful

Comments

  1. Lokesh Choudhary 2017-06-27

    For me when I build the app from appc studio to Android 8.0 API 26 emulator the emulator launches but stays at the black screen & studio logs keeps on saying package manager has not started yet, will try in 2000 ms. If launched from android studio the emulator launches fine but building to an already Android 8.0 started emulator give the same logs. Might be an issue with the Android API 26 system image as well, but I am not 100% sure.
  2. Lokesh Choudhary 2017-07-27

    One difference I noticed in the appc ti info -t android Connected Android Devices section is that the android O device does not have the device name, SDK Version & the ABI's listed.
       Nexus 5
         ID                          = 03055ed008e41a7d
         State                       = device
         SDK Version                 = 6.0.1 (android-23)
         ABIs                        = armeabi-v7a, armeabi
       Android Device                                                     <--- Android O device
         ID                          = 8XV7N16806000094
         State                       = device
       
       
  3. Gary Mathews 2017-08-07

    titanium_mobile: https://github.com/appcelerator/titanium_mobile/pull/9279 node-titanium-sdk: https://github.com/appcelerator/node-titanium-sdk/pull/14
  4. Chris Barber 2017-08-07

    When running the trackDevices test and a device is already connected, it sometimes doesn't find the device and allows the test to immediately exit:
       $ node tests/test-adb.js
       [1] CONNECTED
       [1] SENDING host:track-devices
       [1] RECEIVED 4 BYTES (state=1) (cmd=host:track-devices)
       [1] BUFFER LENGTH = 4
       [1] RESULT OKAY
       [1] DONE, SETTING STATE TO WAIT_FOR_RESPONSE
       [1] RECEIVED 20 BYTES (state=4) (cmd=host:track-devices)
       [1] BUFFER LENGTH = 20
       [1] DONE, RECEIVED RESPONSE
       [1] SOCKET CLOSED BY SERVER 20
       [2] CONNECTED
       [2] SENDING host:transport:001006de0b00
       [2] RECEIVED 4 BYTES (state=1) (cmd=host:transport:001006de0b00)
       [2] BUFFER LENGTH = 4
       [2] RESULT FAIL
       [2] ERROR!
       [2] RECEIVED 35 BYTES (state=0) (cmd=host:transport:001006de0b00)
       [2] SOCKET CLOSED BY SERVER null
       [3] CONNECTED
       [3] SENDING host:transport:192.168.56.101:5555
       [3] RECEIVED 4 BYTES (state=1) (cmd=host:transport:192.168.56.101:5555)
       [3] BUFFER LENGTH = 4
       [3] RESULT FAIL
       [3] ERROR!
       [3] RECEIVED 42 BYTES (state=0) (cmd=host:transport:192.168.56.101:5555)
       [3] SOCKET CLOSED BY SERVER null
       [4] CONNECTED
       [4] SENDING host:transport:192.168.56.101:5555
       [4] RECEIVED 46 BYTES (state=1) (cmd=host:transport:192.168.56.101:5555)
       [4] BUFFER LENGTH = 46
       [4] RESULT FAIL
       [4] ERROR! device '192.168.56.101:5555' not found
       Devices:
       [ { id: '001006de0b00', state: 'device', emulator: false } ]
       
       [4] SOCKET CLOSED BY SERVER null
       
  5. Lokesh Choudhary 2017-08-11

    [~gmathews]. A backport will be needed for this.
  6. Gary Mathews 2017-08-17

    [~lchoudhary] https://github.com/appcelerator/titanium_mobile/pull/9319 for 6.2.0 will include this fix
  7. Lokesh Choudhary 2017-08-17

    Thanks [~gmathews], I am waiting for the CR for https://github.com/appcelerator/node-titanium-sdk/pull/16 which will update the node-titanium-sdk to 0.4.3 & then I can merge the above PR.
  8. Lokesh Choudhary 2017-08-17

    Merged https://github.com/appcelerator/titanium_mobile/pull/9319.
  9. Lokesh Choudhary 2017-08-17

    Hi [~gmathews], How about this commit in https://github.com/appcelerator/titanium_mobile/pull/9279/commits/e2cec28e28f89ed86a3c58c95aabe1c80f92ce68 . Do we need a backport to 6.2.0 for it ?
  10. Gary Mathews 2017-08-18

    [~lchoudhary] 6_2_X: https://github.com/appcelerator/titanium_mobile/pull/9332
  11. Lokesh Choudhary 2017-08-18

    FR passed, master & backport PR merged.
  12. Lokesh Choudhary 2017-08-21

    Verified the fix in SDK 6.2.0.v20170821133426 & 7.0.0.v20170821125551. Closing. Studio Ver: 4.9.1.201707200100 SDK Ver: 6.2.0.v20170821133426, 7.0.0.v20170821125551 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.9 Appc CLI: 6.2.3 Ti CLI Ver: 5.0.14 Alloy Ver: 1.9.13 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 6P --- Android 8.0.0

JSON Source