- 更换阿里源
sudo gedit /etc/apt/sources.list # 打开源文件
#加入源地址(推荐用阿里云源)
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#更新软件列表
sudo apt-get update
#更新软件(把已安装的软件与刚刷新的软件列表中的版本进行对比,如果发现已安装的软件版本太低,就会提示更新)
sudo apt-get upgrade
- 下载 gcc,g++,camek,camek-gui
sudo apt install build-essential # 该命令将安装一堆新包,包括gcc,g ++和make。
sudo apt install cmake # 安装 cmake
sudo apt install cmake-gui #安装 cmake-gui
注意第一步做完后,Ubuntu 会弹出更新信息,必要全部更新下,有很多库是必要的,不然后面会出现问题
配置NDK
sudo gedit /etc/profile
#setNDK env
NDKROOT=/home/t1/android-ndk-r18b
export PATH=$NDKROOT:$PATH
重启电脑,在命令行窗口验证NDK 环境配置是否正确,输入ndk-build