xCode 16 build gradle command failed
Can you select the log and see if you can spot the error message? Or just post the entire log?
@marcprux I think I have a similar problem on my end. Here are my tests:
~/Developer/hello-skip skip checkup
[✓] Skip version 1.2.28 (= 1.2.28)
[✓] macOS version 15.3.1 (> 13.5.0)
[✓] macOS architecture: ARM
[✓] Swift version 6.0.3 (> 5.9.0)
[✓] Xcode version 16.2 (> 15.0.0)
[✓] Xcode tools SDKs: 8
[✓] Homebrew version 4.4.20 (> 4.1.0)
[✓] Gradle version 8.12.1 (> 8.6.0)
[✓] Java version 21.0.5 (> 21.0.0)
[✓] Android Debug Bridge version 1.0.41 (> 1.0.40)
[✓] Android Studio version: 2024.2
[✓] Android tools SDKs: 2
[✓] Resolve dependencies (9.47s)
[✓] Build hello-skip (14.23s)
[✓] Test Swift (8.86s)
[✓] Test Kotlin (39.37s)
[✓] Archive iOS ipa (15.93s)
[✓] Assemble HelloSkip-release.ipa 141 KB
[✓] Verify HelloSkip-release.ipa 141 KB
[✓] Assembling Android apk (90.08s)
[✓] Verify HelloSkip-release.apk 15.1 MB
[✓] Check Skip Updates: 1.2.28
[✓] Skip 1.2.28 checkup succeeded in 179.74s
~/Developer/hello-skip
My JAVA_HOME:
~/Developer/hello-skip echo $JAVA_HOME
/Applications/Android Studio.app/Contents/jbr/Contents/Home
ERROR: JAVA_HOME is set to an invalid directory: /opt/homebrew/opt/java
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
~/Developer/hello-skip cd /opt/
/opt ls -la
total 0
drwxr-xr-x 2 root wheel 64 May 5 2023 .
drwxr-xr-x 22 root wheel 704 Feb 4 11:57 ..
/opt
~/Developer/hello-skip echo $JAVA_HOME /Applications/Android Studio.app/Contents/jbr/Contents/Home
Is this set in your ~/.zshrc or ~/.bashrc file? If so, you may want to just remove it, and then open a new Terminal window and make sure that echo $JAVA_HOME returns nothing.
~/Developer/hello-skip cd /opt/
There is nothing in /opt/? Do you have homebrew installed? What does which brew report?
If it is something like /usr/local/bin/brew, then you probably need to re-install Homebrew (from https://brew.sh), since that indicates the old Intel version that doesn't work with Skip on an M1 ARM Mac.
@marcprux Thank you!
Did reinstalling Homebrew fix it?
@marcprux Yes!
Here are my steps:
brew list # to reinstall after what I need
brew uninstall --cask --force $(brew list --cask)
brew uninstall --force $(brew list --formula)
brew autoremove
brew cleanup
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
rm -rf /usr/local/Homebrew
and start over:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install skiptools/skip/skip
Thanks for the info! A Homebrew installation from an Intel Mac that carries over (via migration) to an ARM Mac has been often seen to exhibit this issue. The programs it install mostly work (via Rosetta emulation of the Intel instructions), but there are a lot of things that break, and Skip is one of them.
We try to identify this situation in skip checkup, so I'm surprised that it didn't give you some kind of warning. I'll look into improving the diagnostics, since the resulting failure is always very obscure and confusing.
All that said, I'm not sure if this is the same as @KhayalSuleymani's issue. If there is any more information on this, please post it here.