From bb832e1238a8fa2a55c7251247dab53f5d01ed7c Mon Sep 17 00:00:00 2001 From: Alex Kring Date: Mon, 26 Jun 2017 20:50:23 -0700 Subject: [PATCH] Akring integration tests fix Summary: Fix a bug that allows us to run integration tests in our android project, where RN is specified as a module to our project. sdkHandler does not exist. The android documentation suggests that we should be using android.ndkDirectory instead. http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0 An alternative solution would be to set the environment variable ANDROID_NDK, but we do not want to rely on setting this environemnt variable at a system wide level. We ran two tests. 1.) perform a gradle sync from within our Android studio project, and verify there is no error output. 2.) build android using ./gradleW, from command land. Verify there are no build errors. Closes https://github.com/facebook/react-native/pull/14136 Differential Revision: D5327421 Pulled By: shergin fbshipit-source-id: d9e18519a8ca318f2026eb409b90cb09e2adbda1 --- ReactAndroid/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 0c704f3232685c..1c217017884d9f 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -168,7 +168,9 @@ def findNdkBuildFullPath() { return new File(ndkDir, getNdkBuildName()).getAbsolutePath() } def ndkDir = android.hasProperty('plugin') ? android.plugin.ndkFolder : - plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() + plugins.getPlugin('com.android.library').hasProperty('sdkHandler') ? + plugins.getPlugin('com.android.library').sdkHandler.getNdkFolder() : + android.ndkDirectory.absolutePath if (ndkDir) { return new File(ndkDir, getNdkBuildName()).getAbsolutePath() }