2

I'm trying to build the Android source code, I followed the instructions from here: https://source.android.com/source/initializing.html

I'm using Ubuntu:

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

I have 2 questions (and problems):

  1. When I run 'lunch' command and choose option number 14 (aosp_hammerhead_userdebug) I get this line many times:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc:cannot execute binary file

and then:

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

  1. Then I run "make" command and I get (again) the line:

/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc:cannot execute binary file

and then:

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.

I installed open-jdk as written in the instruction. Which Java do I need to install instead? (what is the name of the package in apt?)

Thanks

1 Answer 1

2
  1. You need 64 bit Linux to build successfully. You use a 32 bit version.

  2. You need to install the Java Version of Oracle. To avoid any risk you can use Java 7, but it should work with Java 8 too.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. Are you sure that version 8 will work? and what about the first question?
Thank you! I'll try on Ubuntu 64 machine. Can I copy the source code folder or do I need to "repo sync" again?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.