Skip to content

fix: propagate custom ndkVersion to the runtime build#1974

Open
adrian-niculescu wants to merge 1 commit into
NativeScript:mainfrom
adrian-niculescu:fix/propagate-custom-ndkversion
Open

fix: propagate custom ndkVersion to the runtime build#1974
adrian-niculescu wants to merge 1 commit into
NativeScript:mainfrom
adrian-niculescu:fix/propagate-custom-ndkversion

Conversation

@adrian-niculescu

@adrian-niculescu adrian-niculescu commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

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 -PndkVersion property into the android DSL. The catch is that inside the android {} block Groovy resolves names against the extension first, so the ndkVersion argument 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. The else branch only works because defaultNdkVersion isn't a property on the extension, so it falls through to script scope.

Reading it explicitly with project.ndkVersion fixes it. Easy to check: pass -PndkVersion=<something> and android.ndkVersion comes out empty before this change and holds the value after. It usually goes unnoticed because most builds take the else branch, and an empty ndkVersion just makes AGP fall back to a default NDK rather than failing.

Summary by CodeRabbit

  • Chores
    • Updated Android NDK version configuration in the build system to use Gradle properties for improved build configuration management.

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.
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4312aff2-d2fd-4c1d-baa6-a93026193771

📥 Commits

Reviewing files that changed from the base of the PR and between a84d3c7 and b369e91.

📒 Files selected for processing (1)
  • test-app/runtime/build.gradle

📝 Walkthrough

Walkthrough

The test-app/runtime/build.gradle file updates its Android NDK version configuration to source the version from project.ndkVersion property instead of referencing a direct variable, aligning the build configuration with Gradle property conventions.

Changes

Android NDK Version Configuration

Layer / File(s) Summary
NDK version property reference
test-app/runtime/build.gradle
The ndk { ndkVersion ... } block now reads the configured Android NDK version from project.ndkVersion property instead of a direct ndkVersion variable reference.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A property so small, yet so fine,
From variable to project.ndkVersion it's time,
One little line, a gradle delight,
The rabbit hops through, getting it right! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing the propagation of a custom ndkVersion to the runtime build by using the correct project property reference.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant