Introduction to the

6. We express a Build Environment.

  • Important:  Platform development on MacOS isn’t supported as of June 22, 2021.
  • Official recommendation Ubuntu18.04
  • Try using Ubuntu18.04!!
  • Try using Ubuntu18.04!!
  • Try using Ubuntu18.04!!

Environment:

MacOS Big Sur 11.6 (20G165) MacBook Pro (15-inch, 2018) 2.9ghz 6-core Intel Core I9 32 GB 2400 MHz DDR4Copy the code

Rapid command

Tsinghua mirror

Repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest - b android - 11.0.0 _r3 repo sync source Sh lunch aosp_x86_64-eng make SELINUX_IGNORE_NEVERALLOWS=true -j6 emulatorCopy the code

Problems and Methods

MAC OSX in particular is problematic, you can refer to yongfengnice MAC under the compile Android system source code and compile specified modules

  1. File descriptor restrictions
  2. No supported SDK version is available. 10.10 to 10.15, while the machine is 12.0 to modify the build/soong/cc/config/x86_darwin_host. Go to complete;
  3. PAGE_SIZE Problem: Add the PAGE_SIZE macro definition. #define PAGE_SIZE 4096
system/core/base/cmsg.cpp:78:21: error: use of undeclared identifier 'PAGE_SIZE' 
if (cmsg_space >= PAGE_SIZE) {
Copy the code
  1. Python2/3 MAC compatibility issues
external/python/cpython2/Modules/getpath.c:414:50: 
error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint32_t *' (aka 'unsigned int *') [-Werror,-Wincompatible-pointer-types]
Copy the code

Methods:

External/python/cpython2 / Modules/getpath c editing getpath. C file, add the header file. #include <AvailabilityMacros.h>Copy the code
  1. Test to discard vagrant/virutualbox under Ubuntu18.04;
2. Failed to listen for path logs: listen Unix out/. Path_interposer_log: bind: operation not supportedCopy the code

to-do

  1. Problem: there is no corresponding supported SDK version: download MAC OSx-SDKS 10.14, 10.15, it does not take effect

Miscellaneous chop suey

  • The current version is: Android-11.0.0_R3
  • Still comfortable with MacBookPro overall, why did AOSP abandon MacOS?
  • In order to see the code trace in MBP, AOSP compilation in macOS;
  • AOSP for the device, ready only in Ubuntu18.04’s build service