Hi there,
has anyone already put together a working setup script that will install everything needed for Android (Kotlin) development in ChatGPT Codex?
I tried some things but because the terminal is not really “interactive” it is hard to debug.
Hi there,
has anyone already put together a working setup script that will install everything needed for Android (Kotlin) development in ChatGPT Codex?
I tried some things but because the terminal is not really “interactive” it is hard to debug.
Set environment variable:
ANDROID_HOME to /usr/lib/android-sdkAnd use the following setup script:
echo "Getting Android Studio"
wget -O android-commandlinetools.zip https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip
echo "Unpacking Android Studio"
unzip android-commandlinetools.zip -d /usr/lib/android-sdk
echo "Updating sdkmanager"
/usr/lib/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk/ --update
echo "Installing Android SDK"
bash -c 'yes | /usr/lib/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk/ "platforms;android-35"'
echo "Git Submodule Init"
git submodule update --init --recursive
Note: It seems the bash -c '...' is necessary when installing the Android SDK with sdkmanager, otherwise I always got an error that indicated a broken pipe, probably from the way the setup script is executed in the environment.
Providing this for the community. If you want to include testing for code include the below. Looks a bit weird, but this was the only way I could get codex to understand that I was accepting the liceses.
Set environment variable:
* `ANDROID_HOME` to `/usr/lib/android-sdk`
echo "Getting Android Studio"
wget -O android-commandlinetools.zip `https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip`
echo "Unpacking Android Studio"
unzip android-commandlinetools.zip -d /usr/lib/android-sdk
# — point both shell and Gradle at the same SDK path —
export ANDROID_HOME=/usr/lib/android-sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH
# create local.properties in your repo root so the Android plugin picks it up
echo "sdk.dir=$ANDROID_HOME" > /workspace/MyIPTVDVR/local.properties
echo "Updating sdkmanager"
/usr/lib/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk/ --update
# accept all licenses
echo "Accepting Android SDK licenses"
/usr/lib/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk/ --licenses <<EOF
y
y
y
y
y
y
y
y
EOF
echo "Installing Android SDK components"
/usr/lib/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=/usr/lib/android-sdk \
"platform-tools" \
"platforms;android-35" \
"build-tools;35.0.0" <<EOF
y
EOF
echo "Git Submodule Init"
git submodule update --init --recursive
Hi
What is your solution for Kotlin Multiplatform and Compose Multiplatform (Android, IOS, Desktop, WasmJs)?
@bekoeppel @dadsthatcode Thanks for posting these scripts. It was really helpful. I saw that you both are using git submodules. How did you get them to work? I’ve granted codex access to all the private repos on Github that are git submodules, but I keep getting these errors when running git submodule update --init --recursive:
Cloning into '/workspace/[main_project]/libraries/[submodule]'...
ssh: connect to host github.com port 22: Network is unreachable
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
You might have to add your submodules with a https:// git URL instead of a ssh:// URL.
When I try https URLs it seems to just hang forever on:
Cloning into '/workspace/[main_project]/libraries/[submodule]'...