安装NDK在Ubunbu 8.10上的时候遇到下面问题:
LittleNine@LittleNine:~/android-ndk-1.5_r1$sudo ./host-setup.sh
[sudo] password for e13353:
./host-setup.sh: 23: source: not found
Detecting host toolchain.
./host-setup.sh: 57: force_32bit_binaries: not found
./host-setup.sh: 58: setup_toolchain: not found
./host-setup.sh: 60: cannot create : Directory nonexistent
Can't create directory for host config file: out/host
解决方法:
修改host-setup.sh第一行的#!/bin/sh为#!/bin/bash,然后运行就成功了,成功打印如下:
LittleNine@LittleNine:~/android-ndk-1.5_r1$ sudo ./build/host-setup.sh
[sudo] password for LittleNine:
Detecting host toolchain.
CC : compiler check ok (gcc)
LD : linker check ok (gcc)
CXX : C++ compiler check ok (g++)
Generate : out/host/config.mk
Toolchain : Checking for arm-eabi-4.2.1 prebuilt binaries
Host setup complete. Please read docs/OVERVIEW.TXT if you don't know what to do.
关于如何再Windows安装,请参见我的另一篇转载文章HWOTO install and setup Android NDK for Windows(Android NDK 开发环境安装和配置)