fix: propagate custom ndkVersion to the runtime build#1974
fix: propagate custom ndkVersion to the runtime build#1974adrian-niculescu wants to merge 1 commit into
Conversation
Inside the android {} block names resolve delegate-first, so the
`ndkVersion ndkVersion` argument reads the extension's own (empty)
value and assigns it back to itself. The -PndkVersion project property
never reaches AGP. Read it explicitly with project.ndkVersion so the
configured NDK is actually applied.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesAndroid NDK Version Configuration
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
While building the runtime with a custom NDK version I noticed it never actually took effect. It comes down to this in
test-app/runtime/build.gradle:if (hasNdkVersion) { ndkVersion ndkVersion }This was added in cbd0ab1 to forward a
-PndkVersionproperty into theandroidDSL. The catch is that inside theandroid {}block Groovy resolves names against the extension first, so thendkVersionargument hits the extension's own getter, which is still empty there, and the line just assigns that empty value back to itself. The project property is never read. Theelsebranch only works becausedefaultNdkVersionisn't a property on the extension, so it falls through to script scope.Reading it explicitly with
project.ndkVersionfixes it. Easy to check: pass-PndkVersion=<something>andandroid.ndkVersioncomes out empty before this change and holds the value after. It usually goes unnoticed because most builds take theelsebranch, and an emptyndkVersionjust makes AGP fall back to a default NDK rather than failing.Summary by CodeRabbit