Android Development Environment: Difference between revisions
No edit summary |
|||
Line 2: | Line 2: | ||
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- | --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- | ||
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!-- | --> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!-- | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} Creating Android Development Environment}} {{DocImage|category1={{#var:HARDWARE_NAME}} | --> {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} - Creating an Android Development Environment}} {{DocImage|category1=Android|category2={{#var:HARDWARE_NAME}}}} __toc__ | ||
= Host PC requirements = | |||
The host development environment for Android is based on Ubuntu and Debian, please install one of the following | The host development environment for Android is based on Ubuntu and Debian, please install one of the following | ||
* Ubuntu version 14.04/16.04 64bit LTS | * Ubuntu version 14.04/16.04 64bit LTS | ||
Line 28: | Line 28: | ||
* Linux Machine: https://help.ubuntu.com/community/Installation/FromUSBStick | * Linux Machine: https://help.ubuntu.com/community/Installation/FromUSBStick | ||
Follow your Linux Distro specific wizards to install build OS. | Follow your Linux Distro specific wizards to install build OS. | ||
= Install required packages on host PC = | |||
Before you begin, make sure you installed correct version of build OS on your build machine. | Before you begin, make sure you installed correct version of build OS on your build machine. | ||
You can verify by using below commands | You can verify by using below commands | ||
Line 47: | Line 48: | ||
</pre> | </pre> | ||
= Install the OpenJDK = | |||
Android Nougat requires OpenJDK 8. | Android Nougat requires OpenJDK 8. | ||
Revision as of 10:23, 1 January 2020
Host PC requirements
The host development environment for Android is based on Ubuntu and Debian, please install one of the following
- Ubuntu version 14.04/16.04 64bit LTS
- Ubuntu LTS 14.04 64 bit - Download it from : http://releases.ubuntu.com/14.04/ubuntu-14.04.6-desktop-amd64.iso
- Ubunut LTS 16.04 64 bit - Download it from : http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso
- Debian 8.4 64bit https://www.debian.org/releases
We recommend to have physical build machine with at least below Hardware Configuration:
- CPU : Intel / AMD Quad Core or higher CPU cores with base frequency 2.3 Ghz or higher.
- RAM : you need at least 16GB of RAM
- SSD (Recommended) : 450 GB OR HDD : 500 GB Free space
- Internet Connectivity
Note: The build process requires about 135GB of free space. Before any build, make sure you have adequate free space available on HDD / SDD before starting any build.
Note: Do not use other Ubuntu or Debian releases, than the ones recommended above.
Note: If you plan to use Virtual machines, make sure you have given at least 16 GB RAM allocated to the Linux Virtual Machine.
- Otherwise your build may fail, as Android build requires quite significant resources specialy during linking stage the RAM usage minimumm 16 GB RAM is required.
You could use USB pendrive to boot and install if you wish to,
- Windows : https://rufus.ie/ and give above ISO as source, and follow https://rufus.ie/ guide
- Linux Machine: https://help.ubuntu.com/community/Installation/FromUSBStick
Follow your Linux Distro specific wizards to install build OS.
Install required packages on host PC
Before you begin, make sure you installed correct version of build OS on your build machine. You can verify by using below commands
$ uname -a | grep "x86_64"
You should get output like below
Linux user-desktop 4.15.0-72-generic #81~16.04.1-Ubuntu SMP Tue Nov 26 16:34:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Notice the "x86_64" string, if you have installed other (32 bit version) such OS flavor for Android build is not supported currently.
$ sudo apt-get update $ sudo apt-get -y install gnupg flex bison gperf build-essential zip gcc-multilib g++-multilib $ sudo apt-get -y install libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev $ sudo apt-get -y install ccache libgl1-mesa-dev libxml2-utils xsltproc unzip bc $ sudo apt-get -y install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git curl $ sudo apt-get -y install u-boot-tools mtd-utils android-tools-fsutils device-tree-compiler gdisk m4 libz-dev
Install the OpenJDK
Android Nougat requires OpenJDK 8.
To install it:
$ sudo apt-get update $ sudo apt-get install openjdk-8-jdk
If your Ubuntu version is missing the package (which shouldn't happen), add the PPA repository and run the previous commands again:
$ sudo add-apt-repository ppa:openjdk-r/ppa
Update the default Java version by running:
$ sudo update-alternatives --config java $ sudo update-alternatives --config javac