Skip to content

Update Build.gradle #33507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update Build.gradle #33507

wants to merge 1 commit into from

Conversation

Morritz
Copy link
Contributor

@Morritz Morritz commented Mar 27, 2022

This change allows to configure the NDK version in root project.

Summary

This change was motivated by the problem with compilation of new architecture on ARM chips with ndk-build.
This change combined with setting newer version inside root project's build.gradle allows end-user to compile successfully.

Changelog

[Android] [Feature] - This change allows user to change NDK version used by ReactAndroid inside their root project's build.gradle file.

Test Plan

This change allows to configure the NDK version in root project.
@facebook-github-bot
Copy link
Contributor

Hi @Morritz!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 27, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@@ -280,6 +280,7 @@ task androidSourcesJar(type: Jar) {

android {
compileSdkVersion 31
ndkVersion rootProject.ext.ndkVersion
Copy link
Contributor

@leotm leotm Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was setting this too earlier in Android Studio manually when integrating other libraries, since it wasn't being picked up from rootProject

So i've had a yarn patch stash sitting awhile locally, but avoided committing it in the end (could jus be me)

I don't see the harm including it, but assumed it wasn't for a reason - can't think of side-effects it would cause atm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there needs to be such change made in order to make developer's life easier. Especially in early phases of development like starting with the template which already should have as I remember correctly some ndk version put there, but if developer wants to upgrade it to newer version manually then I see no problem there. Maybe it would be better for the ReactAndroid to update this ndk as internal dependency to support M1 platform, but still someone might want to use some version that he has already installed and if there is no problem with that as you mentioned, this change would be beneficial, because it would reduce digging through the deeps of the code to set it somewhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly it helps with ndk-build, which was also addressed in other dev commit that i have seen in repo and that change was to replace ndk-build with cmake build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha and thanks the explanation earlier ^ appreciate it

Just back from a mini-break and spotted (thx too @cortinico)

Which looks like it'll resolve our NDK issue too, I'll check later today

@cortinico
Copy link
Contributor

Which looks like it'll resolve our NDK issue too, I'll check later today

@leotm you're right. I've pushed a change to allow customizing the NDK version on the top level, mostly for M1 users. The change is a bit more extensive than what was proposed by @Morritz as it needed to propagate the config for the ReactAndroid project otherwise it would have not been picked up correctly.

I'm closing here, but thanks for the contrib @Morritz 🙏

@cortinico cortinico closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants