fix: re-pin Flutter's JDK path on devbox init
Some checks failed
Release APK / build (push) Failing after 1m16s
Some checks failed
Release APK / build (push) Failing after 1m16s
Flutter caches its JDK location in a per-user global config file (~/.config/settings), not per-project. On a shared build host that cross-contaminates between projects: whichever project last ran without pinning inherits a stale jdk-dir pointing at another project's (possibly already-gone) build directory, which breaks the Gradle release build with "JAVA_HOME is set to an invalid directory". Re-running flutter config --jdk-dir on every devbox shell init keeps it correct for this project.
This commit is contained in:
parent
68e3c529cb
commit
8ab38f0e8c
1 changed files with 1 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
|||
},
|
||||
"shell": {
|
||||
"init_hook": [
|
||||
"flutter config --jdk-dir \"$(dirname \"$(dirname \"$(command -v java)\")\")\" > /dev/null",
|
||||
"flutter --version",
|
||||
"if command -v android >/dev/null 2>&1; then export ANDROID_HOME=$(command -v android | sed -E 's|(.*libexec/android-sdk).*|\\1|'); fi",
|
||||
"if [ -n \"$ANDROID_HOME\" ]; then export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH; fi"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue