【问题标题】:Building Android source code on Ubuntu在 Ubuntu 上构建 Android 源代码
【发布时间】:2014-12-08 09:29:14
【问题描述】:

我正在尝试构建 Android 源代码,我按照此处的说明进行操作: https://source.android.com/source/initializing.html

我正在使用 Ubuntu:

Linux 用户-Ubuntu 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:42:40 UTC 2014 i686 i686 i386 GNU/Linux

我有 2 个问题(和问题):

  1. 当我运行“午餐”命令并选择选项编号 14 (aosp_hammerhead_userdebug) 时,我多次收到此行:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc:cannot 执行二进制文件

然后:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
TARGET_PRODUCT=aosp_hammerhead
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-15-generic-i686-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=KOT49H
OUT_DIR=out
============================================

可以吗?如果没有,我需要做什么?

  1. 然后我运行“make”命令,我得到(再次)该行:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc:cannot 执行二进制文件

然后:

Checking build tools versions...
************************************************************
You are attempting to build with an unsupported JDK.

You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
    https://source.android.com/source/download.html
************************************************************
build/core/main.mk:152: *** stop.  Stop.

我按照说明安装了 open-jdk。 我需要安装哪个 Java?(apt 中的包名称是什么?)

谢谢

【问题讨论】:

    标签: android ubuntu android-source


    【解决方案1】:
    1. 您需要 64 位 Linux 才能成功构建。您使用的是 32 位版本。

    2. 您需要安装Java Version of Oracle。为避免任何风险,您可以使用 Java 7,但它也应该适用于 Java 8。

    【讨论】:

    • 谢谢。你确定版本 8 可以工作吗?那么第一个问题呢?
    • 谢谢!我将在 Ubuntu 64 机器上尝试。我可以复制源代码文件夹还是需要再次“repo sync”?
    猜你喜欢
    • 1970-01-01
    • 2016-01-09
    • 2016-04-28
    • 2014-10-09
    • 2015-03-22
    • 2015-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多