aerokube / images

Browser images for Selenoid and Moon 1.x
https://aerokube.com/images/latest/
Apache License 2.0
169 stars 127 forks source link

Android 9 and 10 errors in CentOS 7 #187

Open emilorol opened 4 years ago

emilorol commented 4 years ago

I was able to convert the android Dockerfile to use CentOS 7 instead of Ubuntu and I can build Android 8.1, but when trying to build Android 9 or 10 I get the following error:

resize2fs: Bad magic number in super-block while trying to open /root/.android/avd/android9.0-1.avd/userdata.img

I was able to fix that error by expanding the drive using qemu-img instead:

find original line:

resize2fs /root/.android/avd/$AVD_NAME.avd/userdata.img "$USERDATA_SIZE"M && \

replace it with:

/opt/android-sdk-linux/emulator/qemu-img resize -f raw /root/.android/avd/$AVD_NAME.avd/userdata.img "$USERDATA_SIZE"M && \

Now when looking at the container logs I see the following:

Your emulator is out of date, please update by launching Android Studio:
 - Start Android Studio
 - Select menu "Tools > Android > SDK Manager"
 - Click "SDK Tools" tab
 - Check "Android Emulator" checkbox
 - Click "OK"

One more thing, the latest version of the build tools is 29.0.2

Any ideas?

vania-pooh commented 4 years ago

@emilorol thank you for doing a research on this! This error was the reason why we did not build Android 9+ images. Now regarding emulator version - yes, we are also seeing from time to time this message, however sdkmanager tool should install latest available version.

emilorol commented 4 years ago

I even added the following line, but does not make a difference.

sdkmanager --update

But it didn't make a difference.