agoda-com / docker-emulator-android

Dockerized android emulator
Apache License 2.0
250 stars 64 forks source link

Could not build android-28 #11

Closed reardenlife closed 5 years ago

reardenlife commented 5 years ago

I modified a Makefile so it includes only android-28:

VERSIONS ?= android-28

Then I ran 'make build' and now I am having this:

Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  openjdk-8-jdk* unzip*
  0 upgraded, 0 newly installed, 2 to remove and 5 not upgraded.
  After this operation, 2,134 kB disk space will be freed.
  (Reading database ... 26126 files and directories currently installed.)
  Removing openjdk-8-jdk:amd64 (8u212-b03-0ubuntu1.18.04.1) ...
  Removing unzip (6.0-21ubuntu1) ...
  Processing triggers for mime-support (3.60ubuntu1) ...
  (Reading database ... 26091 files and directories currently installed.)
  Purging configuration files for unzip (6.0-21ubuntu1) ...
  WARNING: Image format was not specified for '/root/.android/avd/x86.avd/userdata.img' and probing guessed raw.
           Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
                    Specify the 'raw' format explicitly to remove the restrictions.
                    Image resized.
                    e2fsck 1.44.1 (24-Mar-2018)
                    ext2fs_open2: Bad magic number in super-block
                    e2fsck: Superblock invalid, trying backup blocks...
                    e2fsck: Bad magic number in super-block while trying to open /root/.android/avd/x86.avd/userdata.img
                    The superblock could not be read or does not describe a valid ext2/ext3/ext4
                    filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
                    filesystem (and not swap or ufs or something else), then the superblock
                    is corrupt, and you might try running e2fsck with an alternate superblock:
                        e2fsck -b 8193 <device>
                         or
                             e2fsck -b 32768 <device>

                             The command '/bin/sh -c dpkg --add-architecture i386 &&     echo "deb mirror://mirrors.ubuntu.com/mirrors.txt bionic main restricted universe multiverse" > /etc/apt/sources.list &&     echo "deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list &&     echo "deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-security main restricted universe multiverse" >> /etc/apt/sources.list &&     echo "deb mirror://mirrors.ubuntu.com/mirrors.txt bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list &&     apt-get update &&     DEBIAN_FRONTEND=noninteractive apt-get install -yq software-properties-common libstdc++6:i386 zlib1g:i386 libncurses5:i386                         locales ca-certificates apt-transport-https curl unzip redir iproute2                         openjdk-8-jdk xvfb x11vnc fluxbox nano libpulse0 telnet expect                        --no-install-recommends &&     locale-gen en_US.UTF-8 &&     curl -L $LINK_ANDROID_SDK > /tmp/android-sdk-linux.zip &&     unzip -q /tmp/android-sdk-linux.zip -d /opt/android-sdk-linux/ &&     rm /tmp/android-sdk-linux.zip &&     yes | sdkmanager --no_https --licenses &&     yes | sdkmanager emulator tools platform-tools "platforms;android-28" "system-images;android-28;google_apis;x86" --verbose | uniq &&     echo no | avdmanager create avd -n "x86" --package "system-images;android-28;google_apis;x86" --tag google_apis &&     DEBIAN_FRONTEND=noninteractive apt-get purge -yq unzip openjdk-8-jdk &&     qemu-img convert -O qcow2 -c /opt/android-sdk-linux/system-images/android-28/google_apis/x86/system.img /opt/android-sdk-linux/system-images/android-28/google_apis/x86/system.qcow2 &&     mv /opt/android-sdk-linux/system-images/android-28/google_apis/x86/system.qcow2 /opt/android-sdk-linux/system-images/android-28/google_apis/x86/system.img &&     qemu-img convert -O qcow2 -c /opt/android-sdk-linux/system-images/android-28/google_apis/x86/userdata.img /opt/android-sdk-linux/system-images/android-28/google_apis/x86/userdata.qcow2 &&     mv /opt/android-sdk-linux/system-images/android-28/google_apis/x86/userdata.qcow2 /opt/android-sdk-linux/system-images/android-28/google_apis/x86/userdata.img &&     qemu-img resize /root/.android/avd/x86.avd/userdata.img 2G &&     e2fsck -fy /root/.android/avd/x86.avd/userdata.img &&     resize2fs /root/.android/avd/x86.avd/userdata.img &&     qemu-img convert -O qcow2 -c /root/.android/avd/x86.avd/userdata.img /root/.android/avd/x86.avd/userdata.qcow2 &&     mv /root/.android/avd/x86.avd/userdata.qcow2 /root/.android/avd/x86.avd/userdata.img &&     (qemu-img convert -O qcow2 -c /opt/android-sdk-linux/system-images/android-28/google_apis/x86/vendor.img /opt/android-sdk-linux/system-images/android-28/google_apis/x86/vendor.qcow2 &&     mv /opt/android-sdk-linux/system-images/android-28/google_apis/x86/vendor.qcow2 /opt/android-sdk-linux/system-images/android-28/google_apis/x86/vendor.img || true) &&     apt-get -yq autoremove &&     apt-get clean &&     apt-get autoclean &&     rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*' returned a non-zero code: 8
                             make[1]: *** [build] Error 8
                             make[1]: Leaving directory `/opt/docker-emulator-android/build/android-28'
                             make: *** [build] Error 2

What might be a problem?

reardenlife commented 5 years ago

Interesting.. I had a directory /root/.android, but without directory avd in it. So I removed directory /root/.android and tried to rebuild. Now even /root/.android is absent altogether (after the rebuild).

reardenlife commented 5 years ago

Hm. Android-26 has been built successfully.

reardenlife commented 5 years ago

Oh, well. Is there any way to build for a CPU architecture that doesn't require hardware acceleration?

reardenlife commented 5 years ago

Eventually I decided to ask my VPS provider to connect Android x86_64 RC2 image to my KVM server and through the proxmox's noVNC I was able to install the OS. :)

tianna1121 commented 4 years ago

Got the same errors when building android-28 on a bare metal ubuntu 18.04 server.