Skip to content

Conversation

@ChubaOraka
Copy link

The persistence of the Android Studio configuration is improved running the new command. However, there seems to be a bug in the new version as I cannot type ENTER on the Android Studio terminal. I'm not sure whether this is a bug with the Android Studio version or something else.

I included the previous version in the Docker builds and tagged on GitHub as appropriate.

ChubaOraka and others added 5 commits April 16, 2022 14:11
The persistency of the Android Studio configuration is improved by mounting /home/developer/.config

Source:
Use volumes | Docker Documentation
https://docs.docker.com/storage/volumes/#choose-the--v-or---mount-flag
The source URL now points to a different version of Android Studio.
The URL from the Android Studio download archives website is slightly
different, the line below would also have been valid:
`ARG studio_source=https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2020.3.1.26/android-studio-2020.3.1.26-linux.tar.gz`

Sources:
Android Studio download archives  |  Android Developers
https://developer.android.com/studio/archive
To comply with compatibility requirements for running
Android Studio Arctic Fox (2020.3.1) Patch 4, Java needs to
be upgraded in the Docker image

Error Message (Resolved):
java - Upgrading from openJDK 8 to openJDK 11 - Stack Overflow

Sources:
Android Studio Error "Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8" - Stack Overflow
https://stackoverflow.com/questions/66980512/android-studio-error-android-gradle-plugin-requires-java-11-to-run-you-are-cur

java - Upgrading from openJDK 8 to openJDK 11 - Stack Overflow
https://stackoverflow.com/questions/63699194/upgrading-from-openjdk-8-to-openjdk-11
https://stackoverflow.com/a/63699326
https://stackoverflow.com/questions/63699194/upgrading-from-openjdk-8-to-openjdk-11/63699326#63699326
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /dev/bus/usb:/dev/bus/usb \
-v /usr/share/X11/xkb:/usr/share/X11/xkb:ro \
-v ~/.AndroidStudio:/home/developer/.AndroidStudio \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the reason behind these changes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes are reflective of how the Android Studio binaries are located in my local installation, e.g. -v ~/.AndroidStudio.sdk:/home/developer/Android/Sdk, so you may overlook or rename accordingly. I found some of the mounts to be unnecessary, like -v ~/.AndroidStudio:/home/developer/.AndroidStudio and -v ~/.AndroidStudio.android:/home/developer/.android. The most important volume mount is -v ~/.AndroidStudio.config:/home/developer/.config, I noticed that it makes the configuration after first startup more persistent.

-v ~/Android/:/home/developer/Android/Sdk \
-v "$PWD:/home/developer/Project" \
--name androidstudio-$(head -c 4 /dev/urandom | xxd -p)-$(date +'%Y%m%d-%H%M%S') \
chubaoraka/docker-androidstudio
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to point this at your DockerHub account?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because I uploaded the Arctic Fox image on my account.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I'd perhaps propose archiving this repo with some pointers to your repo if you'd be interested in maintaining this image? I no longer do Android dev, so it's unlikely I'll bump this often...

What do you think? If you're happy with that, perhaps replace this PR with one that changes the Readme only to clearly point to your repo, and we could get that in (and then I could archive this repo)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

@rycus86
Copy link
Owner

rycus86 commented Apr 22, 2022

Thanks a lot for looking into this! I haven't used AndroidStudio in a long while, which is why this hasn't been updated. I left some comments for clarification please, and I expect you tested this build locally?

-v ~/Android/:/home/developer/Android/Sdk \
-v "$PWD:/home/developer/Project" \
--name androidstudio-$(head -c 4 /dev/urandom | xxd -p)-$(date +'%Y%m%d-%H%M%S') \
chubaoraka/docker-androidstudio
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because I uploaded the Arctic Fox image on my account.

-v ~/Project:/home/developer/Project \
--name androidstudio-$(head -c 4 /dev/urandom | xxd -p)-$(date +'%Y%m%d-%H%M%S') \
rycus86/androidstudio:3.4
-v ~/.AndroidStudio.config:/home/developer/.config \
Copy link
Author

@ChubaOraka ChubaOraka Apr 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line makes the initial configuration of the IDE persistent across restarts.

  -v ~/.AndroidStudio.config:/home/developer/.config \

-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /dev/bus/usb:/dev/bus/usb \
-v /usr/share/X11/xkb:/usr/share/X11/xkb:ro \
-v ~/.AndroidStudio:/home/developer/.AndroidStudio \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes are reflective of how the Android Studio binaries are located in my local installation, e.g. -v ~/.AndroidStudio.sdk:/home/developer/Android/Sdk, so you may overlook or rename accordingly. I found some of the mounts to be unnecessary, like -v ~/.AndroidStudio:/home/developer/.AndroidStudio and -v ~/.AndroidStudio.android:/home/developer/.android. The most important volume mount is -v ~/.AndroidStudio.config:/home/developer/.config, I noticed that it makes the configuration after first startup more persistent.

rycus86/androidstudio:3.4
-v ~/.AndroidStudio.config:/home/developer/.config \
-v ~/.gradle:/home/developer/.gradle \
-v ~/Android/:/home/developer/Android/Sdk \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use your own local directory names

Suggested change
-v ~/Android/:/home/developer/Android/Sdk \
-v ~/.AndroidStudio.sdk:/home/developer/Android/Sdk \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants