mreichelt / docker-android

Docker images for Android development
MIT License
74 stars 11 forks source link

Android SDK Link is out of date #1

Closed sonOfRa closed 5 years ago

sonOfRa commented 5 years ago

The current version is https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip

I think this may be related to the error I'm getting when trying to start an emulator in the container in a gitlab docker runner

"Your emulator is out of date, please update by launching Android Studio"

mreichelt commented 5 years ago

Hi! I assume that you were using the mreichelt/android:latest tag - that one has grown way too large (17,3G uncompressed), which is why I needed to split them up. As a result, you should find many smaller tags here: https://hub.docker.com/r/mreichelt/android/tags/

tl;dr: Only the X-system variants contain the appropriate system image - the others do not even include the emulator.

Let me know if anything is missing, and I'll add it as fast as I can! :)

sonOfRa commented 5 years ago

I was using the 26-system tag. It seems to work in the 28-system tag, but the 26-system tag downloads an older version of the SDK as far as I can tell

mreichelt commented 5 years ago

I checked both the 26-system as well as 28-system locally - both have the latest SDK tools 26.1.1 and the latest emulator 27.3.10. And the latest SDK tools you mentioned are used, as you can see here: https://github.com/mreichelt/docker-android/blob/master/minimal.Dockerfile#L4

Can you provide a short, self contained, correct example for how you get to the "Your emulator is out of date, please update by launching Android Studio" message? Maybe I can fix the problem :)

sonOfRa commented 5 years ago

I have a GitLab CI script that looks like this:

image: mreichelt/android:28-system
minimal:
  stage: minimal
  script:
  - apt install -qq --yes qemu-kvm
  - echo "no" | avdmanager create avd -n $EMULATOR_NAME -k "system-images;android-28;default;x86"
  - $ANDROID_HOME/emulator/emulator -avd $EMULATOR_NAME -no-window -no-audio &
  - echo $! > pidfile
  - ./wait-for-emulator.sh
  after_script:
  - |
    if [ -f pidfile ]; then
      pkill -F pidfile || true
      rm -f pidfile
    fi

The output is here: https://gist.github.com/sonOfRa/92b8d55dfc6000c499404adede9f2a8f Interestingly I can't recreate the old behaviour; now it still complains that the emulator is out of date, but it actually successfully starts the emulator (and in non-minimal examples, also runs the tests)

sonOfRa commented 5 years ago

Closing because I haven't been able to reproduce this at all anymore.

mreichelt commented 5 years ago

It seems it's fixed! 🎉

Thanks a lot for reporting this @sonOfRa - I didn't get around to test this since I didn't have a KVM-enabled CI environment around. In the end, I think the emulator up-to-date check is only a notice so the user is reminded to use the newest emulator.

If you see this message again, maybe there's a new emulator available. Then of course it's time for this Docker image to update to the latest tools. :-)