-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Don't reference null android.ndkDirectory in build.gradle #25088
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
Don't reference null android.ndkDirectory in build.gradle #25088
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This pull request was successfully merged by @petterh in 2aca234. When will my fix make it into a release? | Upcoming Releases |
Thank you for the PR. I have experienced this issue just yesterday and had
to dig into Gradle script to find the cause. And I think that it would be
best to show error or warning rather than silencing it. Could you please
update the PR.
|
Summary: If you (try to) build React Native for Android without having the NDK properly installed and referenced, you get the following error: >A problem occurred evaluating project ':ReactAndroid'. \> Cannot get property 'absolutePath' on null object This is not an overly helpful diagnostic. This PR results in this message instead: >ndk-build binary cannot be found, check if you've set $ANDROID_NDK environment variable correctly or if ndk.dir is setup in local.properties Fixes #25087 ## Changelog [Android] [Fixed] - Show proper error message instead of throwing a NullReferenceException if Gradle cannot find the NDK Pull Request resolved: #25088 Differential Revision: D15559271 Pulled By: cpojer fbshipit-source-id: 35c9a9321af4e4a34bf519144ada48884b48352d
…5088) Summary: If you (try to) build React Native for Android without having the NDK properly installed and referenced, you get the following error: >A problem occurred evaluating project ':ReactAndroid'. \> Cannot get property 'absolutePath' on null object This is not an overly helpful diagnostic. This PR results in this message instead: >ndk-build binary cannot be found, check if you've set $ANDROID_NDK environment variable correctly or if ndk.dir is setup in local.properties Fixes facebook#25087 ## Changelog [Android] [Fixed] - Show proper error message instead of throwing a NullReferenceException if Gradle cannot find the NDK Pull Request resolved: facebook#25088 Differential Revision: D15559271 Pulled By: cpojer fbshipit-source-id: 35c9a9321af4e4a34bf519144ada48884b48352d
Summary
If you (try to) build React Native for Android without having the NDK properly installed and referenced, you get the following error:
This is not an overly helpful diagnostic. This PR results in this message instead:
Fixes #25087
Changelog
[Android] [Fixed] - Show proper error message instead of throwing a NullReferenceException if Gradle cannot find the NDK
Test Plan
Manual testing. Ensure that the Android NDK is improperly referenced (it doesn't matter whether it's actually installed somewhere), then try to sync Android Studio's project with the Gradle files. This will fail with or without this change, but with the change, the developer gets a proper error message instead of an NRE.