lineageos, qemu, emulators, android,

Troubleshooting LineageOS Compilation Errors for QEMU or Emulators

twrix Follow May 11, 2025 · 2 mins read
Troubleshooting LineageOS Compilation Errors for QEMU or Emulators
Share this

Troubleshooting LineageOS Compilation Errors for QEMU or Emulators

Compiling LineageOS for use with QEMU or emulators can sometimes result in errors that need to be addressed. This guide will walk you through common issues and their solutions when compiling LineageOS.

Common Errors and Solutions

1. RepoUnhandledExceptionError

Error Message

Repo command failed due to the following `RepoUnhandledExceptionError` errors:
GitCommandError: 'fetch --quiet --progress aosp --prune --recurse-submodules=no --tags tag android-14.0.0_r67 +refs/tags/android-14.0.0_r67:refs/tags/android-14.0.0_r67 +refs/tags/*:refs/tags/*' on trusty/lk/common failed
stdout: remote: Sending approximately 25.14 MiB ...Counting objects: 1
GitCommandError: 'fetch --quiet --progress aosp --prune --recurse-submodules=no --tags tag android-14.0.0_r67 +refs/tags/android-14.0.0_r67:refs/tags/android-14.0.0_r67 +refs/tags/*:refs/tags/*' on platform/external/truth failed
stdout: fatal: not a git repository: '/home/androiddev/android/lineage/.repo/projects/external/truth.git'

Solution

  1. Check Repository Paths: Ensure that the paths to the repositories are correct. Verify that the directories exist and contain valid Git repositories.

  2. Sync the Repo: Try syncing the repositories again.

     cd /path/to/lineage
     repo sync
    
  3. Remove and Re-add Missing Repositories: If specific repositories are missing, you can remove them from the manifest and re-add them. Edit the default.xml file in the .repo/manifests directory.

  4. Clean Up Corrupted Repositories: If some repositories are corrupted, you can remove them and let repo re-clone them.

     cd /path/to/lineage
     repo forall -c 'git reset --hard'
     repo sync
    
  5. Check the Manifest: Ensure that the manifest file (default.xml or any other manifest file you are using) is correct and points to the right repositories. Validate the manifest using the repo manifest command.

     repo manifest -r
    
  6. Update Repo Tool: Make sure you are using the latest version of the repo tool.

     cd /path/to/lineage
     repo init -u https://android.googlesource.com/platform/manifest
     repo sync
    
  7. Check for Network Issues: Ensure that there are no network issues preventing repo from fetching the repositories.

  8. Check Disk Space: Ensure that there is enough disk space available on your system. Lack of disk space can cause repo to fail.

2. Missing Dependencies

Error Message

error: failed to run: /bin/bash -c 'make -j8'
make: *** No rule to make target 'out/target/product/generic/system.img'.  Stop.

Solution

  1. Install Missing Dependencies: Ensure that all necessary dependencies are installed. For example, on Ubuntu, you can install the required packages using:

     sudo apt-get update
     sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gawk gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libgl1-mesa-dev libgl1-mesa-glx libglapi-mesa libglu1-mesa libglu1-mesa-dev libglx-mesa0 libglx0 libncurses5-dev libsdl1.2-dev libssl-dev libxml2 libxml2-utils lzop openjdk-8-jdk pngcrush rsync schedtool squashfs-tools x11proto-core-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xauth xorg-dev xvfb zlib1g-dev
    
  2. Source the Environment: Make sure to source the environment setup script before compiling.

     . build/envsetup.sh
    

3. QEMU Emulator Issues

Error Message

``` qemu-system-x86_64: error while loading state for instance 0x0 of device ‘goldfish_pipe’

Written by twrix Follow