2

I have built the AOSP in Ubunutu 18.04 using the below commands, but the userdata.img is not generated, and unable to start the emulator.

When I try to create a new emulator from Android Studio AVD, a new emulator started up without any issues.

Why user data image is not generated? Thanks in advance.

$ repo init -u https://android.googlesource.com/platform/manifest
$ repo sync
$ source build/envsetup.sh
$ lunch aosp_car_x86_64-userdebug
$ make -j4
build was successful
$ emulator

emulator: Android emulator version 30.9.0.0 (build_id 7651928) (CL:N/A)
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering beacon_swarm
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering beacon
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering scripted_beacon
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering remote_loopback
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering car_kit
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering classic
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering sniffer
2021-10-10 21:52:31.152 bluetooth - /buildbot/src/android/emu-master-dev/system/bt/vendor_libs/test_vendor_lib/model/setup/device_boutique.cc:33 - Register: Registering keyboard
emulator: WARNING: encryption is off
handleCpuAcceleration: feature check for hvf
[swscaler @ 0x39ac000] No accelerated colorspace conversion found from yuv420p to bgra.
cannot add library /home/<User>/workspace/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library /home/<User>/workspace/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
emulator: ERROR: VkCommonOperations.cpp:537: Failed to create Vulkan instance.
configAndStartRenderer: setting vsync to 60 hz
qemu-system-x86_64: Could not open '/home/<User>/workspace/aosp/out/target/product/generic_car_x86_64/userdata-qemu.img': No such file or directory

List of files in the out/target/product/generic_car_x86_64 directory

drwxrwxr-x 16     4096 Oct 11 16:28 ./
drwxrwxr-x  3     4096 Oct  8 21:57 ../
-rw-rw-r--  1       22 Oct  8 22:07 android-info.txt
drwxrwxr-x 29     4096 Oct  9 12:52 apex/
drwxrwxr-x  2     4096 Oct  9 13:47 appcompat/
drwxrwxr-x  3     4096 Oct  9 20:41 build.avd/
-rw-rw-r--  1       98 Oct  9 10:28 build_fingerprint.txt
-rw-rw-r--  1       67 Oct  9 10:28 build_thumbprint.txt
-rw-r--r--  1 69206016 Oct  9 20:41 cache.img
-rw-r--r--  1   196616 Oct 11 16:28 cache.img.qcow2
-rw-rw-r--  1   194410 Oct  8 21:57 clean_steps.mk
-rw-rw-r--  1       51 Oct  9 10:28 .copied_headers_list
drwxrwxr-x  2     4096 Oct  9 11:39 debug_ramdisk/
drwxrwxr-x  2    12288 Oct  9 11:39 dexpreopt_config/
-rw-rw-r--  1      114 Oct 11 16:28 emu-launch-params.txt
drwxrwxr-x  2     4096 Oct  9 13:43 fake_packages/
drwxrwxr-x  4     4096 Oct  8 22:37 gen/
-rw-rw-r--  1     3338 Oct 11 16:28 hardware-qemu.ini
-rw-------  1        6 Oct 11 16:28 hardware-qemu.ini.lock
-rw-------  1        6 Oct 11 16:26 hardware-qemu.ini.tmp-A4LpOF
-rw-rw-r--  1  3426377 Oct  9 10:28 .installable_files
-rw-rw-r--  1  3426377 Oct  8 22:00 .installable_files.previous
-rw-rw-r--  1  1025766 Oct  9 13:48 installed-files.json
-rw-rw-r--  1     8521 Oct  9 11:55 installed-files-ramdisk.json
-rw-rw-r--  1     2639 Oct  9 11:55 installed-files-ramdisk.txt
-rw-rw-r--  1     3155 Oct  9 11:39 installed-files-root.json
-rw-rw-r--  1      688 Oct  9 11:39 installed-files-root.txt
-rw-rw-r--  1   401433 Oct  9 13:48 installed-files.txt
-rw-rw-r--  1     4717 Oct  8 22:05 misc_info.txt
-rw-rw-r--  1 33768703 Oct  8 22:07 module-info.json
-rw-rw-r--  1 36369198 Oct  8 22:07 module-info.json.rsp
-rw-rw-r--  1        0 Oct 11 16:28 multiinstance.lock
drwxrwxr-x 14     4096 Oct  9 13:50 obj/
drwxrwxr-x  6     4096 Oct  9 11:24 obj_x86/
-rw-rw-r--  1       51 Oct  8 22:00 previous_build_config.mk
drwxrwxr-x 11     4096 Oct  9 11:55 ramdisk/
-rw-rw-r--  1 12934660 Oct  9 11:56 ramdisk.img
drwxrwxr-x 24     4096 Oct  9 11:39 root/
drwxrwxr-x  5     4096 Oct  9 11:55 symbols/
drwxrwxr-x 16     4096 Oct  9 13:45 system/
-rw-rw-r--  1 83827456 Oct  9 13:50 system.img
-rw-rw-r--  1       67 Oct  9 13:50 system-qemu-config.txt
-rw-rw-r--  1  3145728 Oct  9 13:51 system-qemu.img
-rw-rw-r--  1     4096 Oct  9 13:50 vbmeta.img
drwxrwxr-x  4     4096 Oct  9 11:58 vendor/
-rw-rw-r--  1      356 Oct  9 13:50 VerifiedBootParams.textproto
Navaneeth K R
  • 41
  • 1
  • 5

1 Answers1

4

You need to use sdk_car_x86_64-userdebug instead of aosp_car_x86_64-userdebug. The first one will generate all you need for the AVD. The second one just creates a pure GSI.

You can find the sdk lunch entries here: https://cs.android.com/android/platform/superproject/+/master:device/generic/goldfish/car/AndroidProducts.mk

By the way, when you use repo init, you want to specify a branch, otherwise it will use the content of the master branch (and things might not be quite polished there). I guess you want to build AAOS with Android 12, so this would do it:

repo init -u https://android.googlesource.com/platform/manifest -b android-12.0.0_r2
narko
  • 3,645
  • 1
  • 28
  • 33