mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 19:15:05 +00:00
Added a more explicit error message when ndk.dir / ANDROID_NDK is set,
Summary: but the NDK build command can't be found in that directory. This more explicit error now shows the full NDK path where it's looking and (importantly) includes a hint that backslashes need to be escaped on Windows for ndk.dir. When I built on Windows the first time, I didn't realize ndk.dir backslashes needed to be escaped and the generic "not found" error made the root cause harder to track down. This change should help others that build on Windows & run into the same. Closes https://github.com/facebook/react-native/pull/2960 Reviewed By: @svcscm Differential Revision: D2470761 Pulled By: @kmagiera
This commit is contained in:
parent
a85884275d
commit
5b0dd6432a
@ -160,13 +160,20 @@ def findNdkBuildFullPath() {
|
||||
|
||||
def getNdkBuildFullPath() {
|
||||
def ndkBuildFullPath = findNdkBuildFullPath()
|
||||
if (ndkBuildFullPath == null || !new File(ndkBuildFullPath).canExecute()) {
|
||||
if (ndkBuildFullPath == null) {
|
||||
throw new GradleScriptException(
|
||||
"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",
|
||||
null)
|
||||
}
|
||||
if (!new File(ndkBuildFullPath).canExecute()) {
|
||||
throw new GradleScriptException(
|
||||
"ndk-build binary " + ndkBuildFullPath + " doesn't exist or isn't executable.\n" +
|
||||
"Check that the \$ANDROID_NDK environment variable, or ndk.dir in local.proerties, is set correctly.\n" +
|
||||
"(On Windows, make sure you escape backslashes in local.properties or use forward slashes, e.g. C:\\\\ndk or C:/ndk rather than C:\\ndk)",
|
||||
null)
|
||||
}
|
||||
return ndkBuildFullPath
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user