Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9170] Android: run V8 against x86 emulator

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-07T12:02:41.000+0000
Affected Version/sRelease 2.1.0, Release 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-11 Core
ComponentsAndroid
Labelscore, look1, qe-port
ReporterTony Lukasavage
AssigneeStephen Tramer
Created2012-05-18T06:52:47.000+0000
Updated2017-03-16T22:05:37.000+0000

Description

Problem

Currently developers familiar with how to using Android's command line tooling can run Titanium-built APKs against Android new x86 emulator, so long as those APKs were built to run against the Rhino runtime. If the apps are built to run against the V8 runtime, they fail with the following errors from logcat indicating issues with missing stlport libraries. If necessary I can recreate these logs, but they should occur anytime you run a Titanium-built android app using V8 on the Android x86 emulator.

Proposed Solution

The way I understand it is that V8 is compiled with the Android NDK. All code compiled with the Android NDK is architecture-specific, and to this point it has only been built for ARM architectures. I'm sure I'm oversimplifying, but a build of V8 against the x86 architecture would likely make it possible for V8-driven Titanium Android apps to be run on the Android x86 emulator.

Comments

  1. Stephen Tramer 2012-05-25

    Notes on x86 limitations: * x86 emulators do not support google APIs. In particular this means the android manifest cannot reference maps, and any applications which use maps will crash/not work in the x86 emulator. * x86 only works with android SDK r10 (2.3.3) and SDK r15 (4.0.3). Those emulators have to be installed separately from ARM emulators. * x86 may have launch errors involving HAXM (intel hardware acceleration) on some platforms. This is a known issue and Google/Intel are apparently working on fixing it.
  2. Stephen Tramer 2012-06-01

    TESTING

    ---- Before testing, make sure that you have both of the currently available x86 emulators installed (currently available for API r15 and r10). They can be retrieved through the android package management tool. For testing to provide the correct results you *must* install both currently available x86 emulators.

    Testing TiStudio

    *NOTE:* These steps are for Studio 2.0.2. Studio will eventually add ABI selection support and then testing will change significantly. Step 1.

    Create a new app

    Go to Run -> Run Configurations ...

    Select "Titanium Android Emulator"

    Select an API level which is NOT an x86 system image

    Click "Run"

    PASS: App runs FAIL: Any other result Step 2.

    Go to Run -> Run Configurations ...

    Select "Titanium Android Emulator"

    Select an API level which IS an x86 system image (currently only "Intel Atom x86 System Image Android 2.3.3")

    Click "Run"

    PASS: App runs FAIL: Any other result

    Testing avd detection

    Run the following, where $TITANIUM_SDK is the directory where your 2.1.0 SDK is installed, and $ANDROID_SDK is the directory where the Android SDK is installed
       $TITANIUM_SDK/android/avd.py $ANDROID_SDK
       
    You should see the following information in the output: * Every listed device will have an "abis" property, which is an array of the supported ABI levels; only the AVD associated with "4.0.3" is expected to have more than one value ([armeabi-v7a, x86].

    Testing build scripts

    $TITANIUM_SDK and $ANDROID_SDK are as above. You should run this command from the directory which contains the app, which has the name $APP_NAME and ID $APP_ID. $EMU_ID should be the emulator ID for an emulator which supports more than one ABI.
       > $TITANIUM_SDK/android/builder.py simulator $APP_NAME $ANDROID_SDK pwd $APP_ID $EMU_ID "HVGA" x86 ""
       
    PASS: The x86 emulator for 4.0.3 launches, and the app runs in it. FAIL: Any other result. You should then also test the other available ABI (likely armeabi-v7a):
       > $TITANIUM_SDK/android/builder.py simulator $APP_NAME $ANDROID_SDK pwd $APP_ID $EMU_ID "HVGA" armeabi-v7a ""
       
    PASS: The x86 emulator for 4.0.3 launches, and the app runs in it. FAIL: Any other result.
  3. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source