首页 文章

在Ubuntu上构建Android源代码

提问于
浏览
1

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

我正在使用Ubuntu:

Linux用户-Ubuntu 3.11.0-15-通用#25~precision1-Ubuntu SMP Thu 1月30日17:42:40 UTC 2014 i686 i686 i386 GNU / Linux

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

  • 当我运行'lunch'命令并选择选项号14(aosp_hammerhead_userdebug)时,我多次获得此行:

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

然后:

============================================
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
============================================

Is it ok? and if not, what do I need to do?

  • 然后我运行"make"命令,我得到(再次)该行:

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

然后:

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 . Which Java do I need to install instead? (apt中包的名称是什么?)

谢谢

1 回答

  • 2
    • 您需要64位Linux才能成功构建 . 您使用32位版本 .

    • 您需要安装Java Version of Oracle . 为了避免任何风险,您可以使用Java 7,但它也应该与Java 8一起使用 .

相关问题