Android Development Environment: Difference between revisions

From Variscite Wiki
No edit summary
 
(16 intermediate revisions by 4 users not shown)
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}}|category2=Android}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - {{#var:ANDROID_VERSION}} - Creating an Android Development Environment}} {{DocImage|category1=Android|category2={{#var:HARDWARE_NAME}}}} __toc__
== Host (PC) setup requirements ==


The host development environment for Android is based on Ubuntu and Debian, please install
= Host PC requirements =
Ubuntu version 14.04/16.04 64bit LTS [http://www.ubuntu.com/download/desktop http://www.ubuntu.com/download/desktop]
The host development environment for Android is based on Ubuntu.<br>
or
Please install one of the following based on the matrix below:
Debian 8.4 64bit [https://www.debian.org/releases https://www.debian.org/releases]


We recommend to have Physical machine with at least below Hardware Requirements:
{| class="wikitable"
* 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
! Android Version !! Recommended Host OS !! Download URL
* SSD(Recommended) : 450 GB
|-
OR
| Android - Marshmallow 6 or below || Ubuntu 14.04 LTS - 64bit || http://releases.ubuntu.com/14.04/ubuntu-14.04.6-desktop-amd64.iso
* HDD : 500 GB Free space
|-
* Internet Connectivity
| Android - Nougat 7 to Android Oreo - 8|| Ubuntu 16.04 LTS - 64 bit || http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso
<span style="color:red">Note: </span>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.
| Android - Oreo 8 to Android 12 || Ubuntu 18.04 LTS - 64 bit || https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso
|-
| Android - Pie 9 to Android 13 || Ubuntu 20.04 LTS - 64 bit || https://releases.ubuntu.com/focal/ubuntu-20.04.5-desktop-amd64.iso
|-
| Android - 10 to Android 13 || Ubuntu 22.04 LTS - 64 bit || https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso
|}
<br>
 
Minimum hardware requirements for the build machine (A physical build machine is recommended):
* CPU: Intel / AMD 2.3 GHz Quad Core or 8 Core recommended 
* RAM: 48 GB GB RAM recommended ( 16 GB RAM + 32 GB SWAP)
* Free storage: 500 GB with SSD
* Internet connectivity
<br>
Notes:<br>
* The build process requires ~235GB of free storage space. Before starting a build, make sure you have adequate free space available.
You can create a bootable USB drive for installing the host OS. E.g.
* Using Windows: https://rufus.ie
* Using Linux: https://help.ubuntu.com/community/Installation/FromUSBStick
 
Docker Container Usage:
If you want to use Docker, the image can also be built under Docker environment (Windows Container is not supported)
Please refer to
https://github.com/varigit/var-host-docker-containers
And then follow the Android Build process
 
= 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.  


<span style="color:red">Note: </span>Do not use other Ubuntu or Debian releases, than the ones recommended above.


=== Install required packages on host PC ===
<pre>
<pre>
$ sudo apt-get -y install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib \
$ sudo apt-get update
libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc \
$ sudo apt-get -y install gnupg flex bison gperf build-essential zip gcc-multilib g++-multilib  
unzip mtd-utils u-boot-tools lzop liblzo2-2 liblzo2-dev zlib1g-dev liblz-dev uuid uuid-dev android-tools-fsutils bc
$ 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
</pre>
</pre>


=== Install the OpenJDK ===
= Install the OpenJDK =
Android Nougat requires OpenJDK 8.
Android Nougat requires OpenJDK 8.


Line 47: Line 78:
  $ sudo update-alternatives --config java
  $ sudo update-alternatives --config java
  $ sudo update-alternatives --config javac
  $ sudo update-alternatives --config javac
= Using a docker container =
Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.
To learn more, please see Variscite's [[Docker_Build_Environment | Docker Build Environment]] guide.

Latest revision as of 01:01, 16 December 2023

VAR-SOM-MX6 - N7.1.1 - Creating an Android Development Environment

Host PC requirements

The host development environment for Android is based on Ubuntu.
Please install one of the following based on the matrix below:

Android Version Recommended Host OS Download URL
Android - Marshmallow 6 or below Ubuntu 14.04 LTS - 64bit http://releases.ubuntu.com/14.04/ubuntu-14.04.6-desktop-amd64.iso
Android - Nougat 7 to Android Oreo - 8 Ubuntu 16.04 LTS - 64 bit http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso
Android - Oreo 8 to Android 12 Ubuntu 18.04 LTS - 64 bit https://releases.ubuntu.com/18.04/ubuntu-18.04.6-desktop-amd64.iso
Android - Pie 9 to Android 13 Ubuntu 20.04 LTS - 64 bit https://releases.ubuntu.com/focal/ubuntu-20.04.5-desktop-amd64.iso
Android - 10 to Android 13 Ubuntu 22.04 LTS - 64 bit https://releases.ubuntu.com/22.04.3/ubuntu-22.04.3-desktop-amd64.iso


Minimum hardware requirements for the build machine (A physical build machine is recommended):

  • CPU: Intel / AMD 2.3 GHz Quad Core or 8 Core recommended
  • RAM: 48 GB GB RAM recommended ( 16 GB RAM + 32 GB SWAP)
  • Free storage: 500 GB with SSD
  • Internet connectivity


Notes:

  • The build process requires ~235GB of free storage space. Before starting a build, make sure you have adequate free space available.

You can create a bootable USB drive for installing the host OS. E.g.

Docker Container Usage: If you want to use Docker, the image can also be built under Docker environment (Windows Container is not supported) Please refer to https://github.com/varigit/var-host-docker-containers And then follow the Android Build process

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

Using a docker container

Variscite provides Docker containers that can be used for a development environment as an alternative to using a virtual machine or a dedicated computer.

To learn more, please see Variscite's Docker Build Environment guide.