When I try to build Auxio on macOS, Gradle fails at the task assembleFfmpeg.
Steps to Reproduce:
Clone the Auxio repository on a macOS system
Navigate to the repository and run ./gradlew assembleRelease
Describe the intended behavior
The task should succeed and produce an APK in app/build/outputs/apk/release.
What macOS version do you use?
macOS Sonoma 14.2.1
What device model do you use?
MacBook Air M1 2020
Logs
I've uploaded 2 logfiles:
The output of ./gradlew assembleRelease --stacktrace: gradle-log.txt
The logfile generated when you build decoder_ffmpeg: config.log
Let me know if you need more (or less) detail. I think the key portion is here (in config.log):
WARNING: /Users/[removed for privacy]/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-pkg-config not found, library detection may fail.
mktemp -u XXXXXX
9YImwz
test_ld cc
test_cc
BEGIN /var/folders/45/1wggmmf93997x_5s8qwp2xvw0000gp/T//ffconf.iRO1iKKL/test.c
1 int main(void){ return 0; }
END /var/folders/45/1wggmmf93997x_5s8qwp2xvw0000gp/T//ffconf.iRO1iKKL/test.c
/Users/[removed for privacy]/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang -march=armv7-a -mfloat-abi=softfp -march=armv7-a -c -o /var/folders/45/1wggmmf93997x_5s8qwp2xvw0000gp/T//ffconf.iRO1iKKL/test.o /var/folders/45/1wggmmf93997x_5s8qwp2xvw0000gp/T//ffconf.iRO1iKKL/test.c
./configure: line 974: /Users/[removed for privacy]/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang: No such file or directory
C compiler test failed.
It looks like assembleFfmpeg is looking for clang in the wrong place: on macOS the folder under prebuilt will be darwin-x86_64, not linux-x86_64. This might come from the OS check you added in your fork of media3:
def host = ""
if (Os.isFamily(Os.FAMILY_UNIX)) {
host = "linux-x86_64"
} else if (Os.isFamily(Os.FAMILY_MAC)) {
host = "darwin-x86_64"
} else {
throw UnsupportedOperationException(
"Building with Windows is not supported. " +
"Please use WSL or a unix-based operating system.")
}
Based on the Apache Ant documentation and some quick tests I did, it looks like Os.FAMILY_UNIX matches all Unix-like OSs, including macOS. So on macOS this conditional would set host to linux-x86_64 instead of the correct darwin-x86_64. When I swap the order of the Unix and Mac checks the build seems to run okay.
Describe the Bug/Crash
When I try to build Auxio on macOS, Gradle fails at the task
assembleFfmpeg
.Steps to Reproduce:
./gradlew assembleRelease
Describe the intended behavior
The task should succeed and produce an APK in
app/build/outputs/apk/release
.What macOS version do you use?
macOS Sonoma 14.2.1
What device model do you use?
MacBook Air M1 2020
Logs
I've uploaded 2 logfiles:
./gradlew assembleRelease --stacktrace
: gradle-log.txtdecoder_ffmpeg
: config.logLet me know if you need more (or less) detail. I think the key portion is here (in config.log):
Duplicates
Possible Cause
It looks like
assembleFfmpeg
is looking for clang in the wrong place: on macOS the folder underprebuilt
will bedarwin-x86_64
, notlinux-x86_64
. This might come from the OS check you added in your fork of media3:Based on the Apache Ant documentation and some quick tests I did, it looks like
Os.FAMILY_UNIX
matches all Unix-like OSs, including macOS. So on macOS this conditional would sethost
tolinux-x86_64
instead of the correctdarwin-x86_64
. When I swap the order of the Unix and Mac checks the build seems to run okay.