google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
474 stars 251 forks source link

Using GitHub Codespaces for documentation writing does not work due to: "The SDK directory is not writable (/opt/android)" error #2614

Closed vorburger closed 1 week ago

vorburger commented 3 weeks ago

@jingtang10 raised that following https://google.github.io/android-fhir/contrib/docs/ doesn't entirely work for him, and causes the following error, when used from a GitHub Codespace:

Build file '/workspaces/android-fhir/workflow/benchmark/build.gradle.kts' line: 3
What went wrong:
An exception occurred applying plugin request [id: 'androidx.benchmark']
> Failed to apply plugin 'androidx.benchmark'.
   > Could not create task ':lockClocks'.
      > Failed to install the following SDK components:
            build-tools;33.0.1 Android SDK Build-Tools 33.0.1
        The SDK directory is not writable (/opt/android)

I'll figure out what's causing that.

vorburger commented 3 weeks ago

This error actually sounds vaguely familiar... I think I had also run into this - but I forgot the why, and how I had solved this.

vorburger commented 3 weeks ago

Oh! Right, so I had meant to one day contribute a fix for https://github.com/akhildevelops/devcontainer-features/issues/7 - but never got around to it, yet. Will do, when I have a moment. If anyone else reading this wants to get to that before me, please do (and comment here); I don't mind at all!

vorburger commented 3 weeks ago

@jingtang10 FYI you can temporarily work around this with sudo chown -R vscode:vscode /opt/android/.

vorburger commented 3 weeks ago

@jingtang10 I've just created a new Codespace, and with the merge of https://github.com/akhildevelops/devcontainer-features/pull/8, this problem has now been fixed. Anyone should now be able to easily and conveniently work on docs following https://google.github.io/android-fhir/contrib/docs/ (with the pipenv install which was missing that I'm adding in #2315).

jingtang10 commented 3 weeks ago

Love this. Thanks Michael!!!

vorburger commented 3 weeks ago

Actually, no hang on... while following https://google.github.io/android-fhir/contrib/docs/ does work (the Python mkdocs and all), running e.g. ./build-docs.bash STILL fails with this same problem; I'll look more closely into why now...

vorburger commented 3 weeks ago

https://github.com/akhildevelops/devcontainer-features/issues/9 is still needed for this to really be fixed...