[TIMOB-17347] Android: Install fails. Object has no method 'indexOf'
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-07-21T20:58:36.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android, CLI |
| Labels | adb, android, cli, install |
| Reporter | Far |
| Assignee | Chris Barber |
| Created | 2014-07-18T10:26:04.000+0000 |
| Updated | 2017-03-16T22:26:34.000+0000 |
Description
Error was made in https://github.com/appcelerator/titanium_mobile/commit/6d006eba6bc1100fb94e8046e7e53f4ec11f297e.
android/cli/hooks/run.js:
...
(function installApp() {
adb.shell(device.id, 'ps', function (err, output) {
if (output.indexOf('system_server') === -1) {
...
'output' isn't a string so the toString() conversion doesn't work. This creates a problem installing to Android devices
It's more correct to use getPid() from adb.js.
Attachments
| File | Date | Size |
|---|---|---|
| build_log.txt | 2014-07-18T16:35:01.000+0000 | 8709 |
| TIMOB17347.log | 2014-07-21T11:45:11.000+0000 | 45714 |
Thank you for the suggestion. Can you give us a way to reproduce the problem? What is the error you get when it happens?
Master: https://github.com/appcelerator/titanium_mobile/pull/5915 3_3_X: https://github.com/appcelerator/titanium_mobile/pull/5916
I simply ran
I both cases the app successfully installed.[~farwayer] I see the error you are getting and I believe I have fixed in in the PRs above, however the QE team is having a bear of a time trying to reproduce this. We have tested Android builds on Linux with 3.3.0.GA and cannot reproduce. Can you help us by letting us know what exact OS you are using, what version on Node.js, what version of the Android build/platform/sdk tools, what Android target SDK, and what device? Thank you!
Of course, guys:
-ti infoattached- can't attach new file, appended to commentOperating System Name = GNU/Linux Version = Architecture = 64bit # CPUs = 8 Memory = 7.7GB Node.js Node.js Version = 0.10.29 npm Version = 1.4.14 Titanium CLI CLI Version = 3.4.0-dev node-appc Version = 0.2.14 Titanium SDKs 3.4.0 Version = 3.4.0 Install Location = /home/farwayer/.titanium/mobilesdk/linux/3.4.0 Platforms = mobileweb, android git Hash = 82fd1b1 git Timestamp = 07/18/14 22:27 node-appc Version = 0.2.12 Intel® Hardware Accelerated Execution Manager (HAXM) Not installed Java Development Kit Version = 1.7.0_65 Java Home = /usr/lib/jvm/java-7-openjdk Genymotion Path = /usr/bin Genymotion Executable = /usr/bin/genymotion Genymotion Player = not found Home = /home/farwayer/.Genymobile/Genymotion VirtualBox Executable = /usr/bin/VBoxManage Version = 4.3.14_OSEr95030 Android SDK Android Executable = /opt/android-sdk/tools/android ADB Executable = /opt/android-sdk/platform-tools/adb SDK Path = /opt/android-sdk Android NDK NDK Path = /opt/android-ndk NDK Version = r9d (64-bit) Android Platforms 1) android-17 Name = Android 4.2.2 API Level = 17 Revision = 2 Skins = WSVGA, WVGA854, WXGA800, HVGA, WXGA800-7in, WQVGA400, WVGA800, QVGA, WQVGA432, WXGA720 ABIs = no ABIs. Path = /opt/android-sdk/platforms/android-17 2) android-19 Name = Android 4.4.2 API Level = 19 Revision = 3 Skins = WSVGA, WVGA854, WXGA800, HVGA, WXGA800-7in, WQVGA400, WVGA800, QVGA, WQVGA432, WXGA720 ABIs = no ABIs. Path = /opt/android-sdk/platforms/android-19 Android Add-Ons 3) Google Inc.:Google APIs:17 Name = Android 4.2.2 (API level 17) Vendor = Google Inc. Revision = 3 Description = Android + Google APIs Skins = WXGA800, WXGA720, WVGA800, WQVGA400, HVGA, WSVGA, WXGA800-7in, WQVGA432, QVGA, WVGA854 ABIs = armeabi-v7a Path = /opt/android-sdk/add-ons/addon-google_apis-google-17 Libraries = com.google.android.media.effects: Collection of video effects (effects.jar) com.android.future.usb.accessory: API for USB Accessories (usb.jar) com.google.android.maps: API for Google Maps (maps.jar) Android Emulators None Genymotion Emulators Google Nexus One - 2.3.7 - API 10 - 480x800 SDK Version = 2.3.7 ABI = x86 Genymotion Version = 2.2.2 Display = 480x800-16 DPI = 240 OpenGL Acceleration = yes Google APIs = no Samsung Galaxy S5 - 4.4.2 - API 19 - 1080x1920 SDK Version = 4.4.2 (android-19) ABI = x86 Genymotion Version = 2.2.2 Display = 1080x1920-16 DPI = 480 OpenGL Acceleration = yes Google APIs = unknown, emulator not running Motorola Moto X - 4.4.2 - API 19 - 720x1280 SDK Version = 4.4.2 (android-19) ABI = x86 Genymotion Version = 2.2.2 Display = 720x1280-16 DPI = 320 OpenGL Acceleration = yes Google APIs = unknown, emulator not running Connected Android Devices None Genymotion Issues ✕ Unable to locate the Genymotion "player" executable.[~farwayer] Great! Which Linux distro and which Android device are you using?
I am using Arch linux. application is successfully installed to device but not to genymotion emulator.
[~farwayer] Yeah, we just fixed the Genymotion issue with TIMOB-17344. You can get the fix by running:
Hm, just tested behavior with standart android emulator. All ok. Look like the problem appear on Genymotion only. But it's another problem than TIMOB-17344. Commit from TIMOB-17344 didn't help me.
I tried and able to reproduce this issue. See the details below - Environment - acs@1.0.15 alloy@1.4.0 npm@1.3.2 titanium@3.3.0 titanium-code-processor@1.1.1 OS - Ubuntu 12.04 Appcelerator Studio - 3.3.0.201407111535 1) Configured Ubuntu 12.04 system with current 3.3.0 GA environment. 2) Configured Genymotion on the system. 3) Verified that Studio detect the Genymotion configuration correctly. 4) Created a default classic project. 5) From the CLI, run the command - ti build -p android -T emulator -C "GoogleNexus5-4.4.2-API 19-1080x1920" Result - Got the same error as mentioned in this issue. 6) Removed the "modules" folder and 3.3.0 GA build from .titanium folder. 7) Download the build (linux 2) as mentioned in the issue TISTUD-6730. 8) Install the above SDK build from Studio. 9) Run the app again with the same command mentioned in the step 5. Result - Again got the same error message. App did not install on Genymotion emulator. See the attached CLI log file.
I tested this on Mac OS X using the PR above. I was able to install to a Genymotion emulator without issues. I'm not sure if this is a valid test or if the issue exists solely on Linux.
Yep, with PR all ok also on Linux.
[~skypanther] I say we just merge this. The change is low risk and is verified by [~farwayer].
Approved and merged
Closing ticket as fixed.