Repository navigation
fix: the Android Gradle plugin's NDK beats ANDROID_NDK_HOME - #20
Merged
Merged
Conversation
androidNdk tried the environment before the module's AGP NDK, so an ANDROID_NDK_HOME nobody chose won without a message. GitHub's runners preset it to NDK 27, and MikroSoundFont, on NDK 28, published 4 KB-aligned libraries. The order is now DSL, Gradle property, AGP's NDK, environment. An AGP NDK that is not installed still leaves the environment variable. An ANDROID_NDK_HOME that names another NDK and goes unused is reported: konanConfig lists it, and tasks using the NDK warn once per build through a build service, as they run, so the warning survives a configuration cache hit. AGP is on the test classpath for the first time, for the fixtures that apply it. Fixes #19 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
androidNdktriedANDROID_NDK_HOMEbefore the module's Android Gradle plugin NDK. GitHub's runner images preset that variable to NDK 27, so MikroSoundFont, on NDK 28, published 4 KB-aligned libraries from CI with no message (#19).Change
ANDROID_NDK_HOME. An AGP NDK that isn't installed still falls through to the environment variable, and modules without AGP are unaffected.ANDROID_NDK_HOMEnames a different NDK and goes unused, tasks using the NDK warn once per build, naming both paths. It's a build service called as tasks run, so it appears on a configuration cache hit and stays quiet in modules that build nothing for Android.konanConfiglistsANDROID_NDK_HOME=… is not used.Behaviour change: in a module with AGP, an
ANDROID_NDK_HOMEset on purpose no longer wins when AGP's NDK is installed.konan.config.androidNdkor the DSL still override AGP, and the warning says so.Tests
the Android Gradle plugin's NDK beats ANDROID_NDK_HOME…: AGP beats the environment, the Gradle property beats AGP, and an AGP NDK that isn't installed leaves the environment. It fails without the fix.an ANDROID_NDK_HOME the Android Gradle plugin's NDK overrides is warned about once: two Android targets, one warning; none when both name the same NDK.withPluginClasspathAndAgp). Both tests skip on the Gradle 8.7 run, where AGP 9 doesn't run.examples/androidwithANDROID_NDK_HOMEon NDK 29 and AGP on 28: built with 28, one warning per build, also on a configuration cache hit, and the Android tasks stayedUP-TO-DATE.Fixes #19
🤖 Generated with Claude Code