e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 32 forks source link

Android SDK install CI "osx-install-android-sdk-automated" fails regularly, further install issues #1059

Closed the-bay-kay closed 2 months ago

the-bay-kay commented 2 months ago

Issues with Android SDK Install

Personal Build Issues

I've been working on building the android .apk. I've been able to perform the following steps successfully:

CI Failure

Observations

Conclusion, Next Steps

It appears to me that, when running bash setup/prereq_android_sdk_install.sh, we are failing to install the build tools. This does not affect our actual build CI (link), because the android-automated-sdk-install CI creates a separate temporary directory that it installs into, which does not overwrite the preexisting, successful install. This would also explain why:

With all of this information in mind, it appears that bash setup/prereq_android_sdk_install.sh is failing to install incorrectly several components that are vital to the build process. As mentioned above, I believe this is because we only curl for the cmdline-tools ( ⁠link ). It appears that sdkmanager is installing packages, including the build tools, in a location other than the expected $ANDROID_HOME. Once I have a fix written, I'll run some tests and update this thread with further information.

EDIT: Corrected the final thoughts on the error to reflect the actual cause, as mentioned below.

the-bay-kay commented 2 months ago

Build Tool Notes

It appears that we do install andoird-build-tools, but the install is not where we'd expected it. Running $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list | grep build returns build tools 19.1 through 35-rc1. I'm unsure where these files are installed, but they are certainly not being installed in $ANDROID_HOME/build_tools/ , as the documentation would suggest (It's not in ~/.android/, either). I'll update this post when I figure out where these packages are going.

the-bay-kay commented 2 months ago

I haven't been able to find where the packages are being kept. If nothing else, it seems that we may be able to manually set the path with sdkmanager (link).

When inspecting my environment variables (env | grep sdk), the following ENV variables appear:

ANDROID_SDK_ROOT=/Users/{user}/Library/Android/sdk
SDKMAN_PLATFORM=darwinarm64
SDKMAN_CANDIDATES_API=https://api.sdkman.io/2
SDKMAN_DIR=/Users/{user}/.sdkman
SDKMAN_CANDIDATES_DIR=/Users/{user}/.sdkman/candidates

Checking for any variation of build-tools (e.g., find $SDKMAN_DIR -name 'build-tools) reveals nothing...

shankari commented 2 months ago

we should fix the prereq SDK CI before trying to dig deeper into what is wrong (go from working to working). There was a prior error in the SDK CI that was resolved by removing an obsolete package (as we can see from the last commit to the prereq_android_sdk_install.sh file (https://github.com/e-mission/e-mission-phone/commit/5ea9f5883cea177e672724bc8cfff8550c3dec3e) https://github.com/e-mission/e-mission-docs/issues/958#issuecomment-1712314266

From the comment above, the line just below HAXM is patcher. I would try removing patcher (unless it is required), getting the CI to work and then running the fixed scripts on your laptop.

Again, the goal of the CI is to maintain a working version of the scripts. If the CI is broken, we should fix the CI Then, we should make our laptops match the CI

the-bay-kay commented 2 months ago

Changed merged in 1136, closing Issue!