multipass Ubuntu20.04 server 搭建Android编译环境

multipass Ubuntu20.04 server 搭建Android编译环境

环境搭建-安装必要的编译依赖工具

sudo apt-get update
sudo apt-get install  libgl1-mesa-dev g++-multilib git flex bison  build-essential
sudo apt-get install   libxml2-utils xsltproc  dpkg-dev
sudo apt-get install git gnupg flex bison  build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev libgl1-mesa-dev libxml2-utils xsltproc unzip m4 lib32z-dev ccache

sudo apt-get install aptitude
sudo aptitude install libncurses5
sudo apt-get install libssl-dev

安装Java SDK

sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config java
sudo update-java-alternatives -l

配置证书安装;没有请忽略

sudo apt-get install smbclient
sudo update-ca-certificates

Python2.7支持

sudo add-apt-repository universe
sudo apt update 
 
# 如果之前安装了python2,可以跳过这一步
sudo apt install python2
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py 
pip2 --version
# 如果python命令没有,需要创建一个连接
sudo ln -s  /usr/bin/python2.7  /usr/bin/python

ubuntu@primary:~/env-init$  sudo python2 get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pip<21.0
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
 |████████████████████████████████| 1.5 MB 1.2 MB/s
Collecting setuptools<45
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
 |████████████████████████████████| 583 kB 54.9 MB/s
Collecting wheel
  Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-20.3.4 setuptools-44.1.1 wheel-0.37.0
ubuntu@primary:~/env-init$

SSL error Fix;Java 需要打开TSLv1

Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log

SSL error when connecting to the Jack server. Try 'jack-diagnose'

SSL error when connecting to the Jack server. Try 'jack-diagnose'

	# 使用TLSv1
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security
--- java.security 2021-04-30 13:44:46.922768831 +0800
+++ java.security.bak 2021-04-30 13:31:38.754028864 +0800
@@ -716,7 +716,7 @@
 #
 # Example:
 #   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
-jdk.tls.disabledAlgorithms=SSLv3, TLSv1.1, RC4, DES, MD5withRSA, \
+jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \

创建mirror 节省代码空间占用

mkdir -p ~/mirror
repo init -u  -b  --mirror
repo sync -j6

发现multipass server空间不够,扩大一下容量

multipass Ubuntu20.04 server 搭建Android编译环境_第1张图片
multipass Ubuntu20.04 server 搭建Android编译环境_第2张图片
multipass Ubuntu20.04 server 搭建Android编译环境_第3张图片

你可能感兴趣的:(Ubuntu开发系列,android,python)