Appcelerator Blog

The Leading Resource for All Things Mobile

Correcting a Bug in the Latest Google NDK r8e

0 Flares 0 Flares ×

In our continuing effort to inform you of ecosystem issues as we encounter them, the latest NDK toolchain update from Google contains a bug. This causes an issue when building the Titanium Mobile SDK from source. The fix is trivial, and is only necessary if you’ve updated to NDK version r8e, released March 21st, 2013 and are building Titanium Mobile using SCons.

To perform the fix, edit the file build/core/ under the Android NDK directory, replacing line 49:

$(cleantarget): PRIVATE_CLEAN_FILES := ($(my)OBJS) With this: $(cleantarget): PRIVATE_CLEAN_FILES := $($(my)OBJS)
The following output from “scons android” (when building titatitanium_mobile) is a symptom of the problem:
     [exec] rm -f src/native/../../generated/*
     [exec] rm -rf src/native/../../obj/*
     [exec] Clean: kroll-v8 [armeabi]
     [exec] rm -rf (TARGET_OBJS)
     [exec] /bin/sh: -c: line 0: syntax error near unexpected token `(‘
     [exec] /bin/sh: -c: line 0: `rm -rf (TARGET_OBJS)’
     [exec] make: *** [clean-kroll-v8-armeabi] Error 2
  More information can be found here:!topic/android-ndk/3wIbb-h3nDU There is a second issue that only affects Max OS X developers using the 64-bit NDK (i.e. the download with the file name android-ndk-r8e-darwin-x86_64.tar.bz2). The fix is trivial and requires you to make the following one-line changes to these two files: ${ANDROID_NDK}/ndk-build: Replace line 158:

file -L “$SHELL” | grep -q “x86[_-]64”

with this:

file -L “$SHELL” | grep -q “[xX]86[_-]64”

${ANDROID_NDK}/build/core/ Replace line 229:

ifneq (,$(shell file -L $(SHELL) | grep ‘x86[_-]64’))

with this:

ifneq (,$(shell file -L $(SHELL) | grep ‘[xX]86[_-]64’))

As a note, you should be using the 64-bit NDK if your system supports it, since you will get 30% faster builds. The 64-bit tools utilize host resources better (faster, handle larger programs, etc) and they should function identically to their 32-bit counterparts, i.e. 64-bit toolchains still generate 32-bit binaries for Android.

This issue will be fixed by Google in the next release of the NDK. We will update this post with any new information we receive.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×


  1. Aristarhys

    Thank you, i got similiar problem with clean in my project, now it is solved

  2. Pablo

    With every NDK there is a bug that can potentially create disaster for companies relying on google tools.
    We build debug/release builds and because of badly glued tools we have to ndk-build clean before switching to release builds. With this bug wrong builds slipped into our release.
    Can I get address of the person responsible? I’d like to send flowers with a courier.

    Seriously WTF?! just take down existing packages, apply that fix and re-upload fixed istead of putting those unaware into such position!

  3. pellekrogholt

    @ingo thx! the fix work smoothly for me and your posted saved my day…

Comments are closed.

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×