Permalink
Browse files

fix cleanReactNdkLib task failure caused by module not found

Summary:
The `clean` task always fail due to the failure of the `cleanReactNdkLib` task, error messages:

```
:ReactAndroid:cleanReactNdkLib
Android NDK: /my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk: Cannot find module with tag 'react' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
make: Leaving directory `/my/react-native/ReactAndroid/src/main/jni/react/jni'
/my/react-native/ReactAndroid/src/main/jni/react/jni/Android.mk:31: *** Android NDK: Aborting.    .  Stop.
:ReactAndroid:cleanReactNdkLib FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:cleanReactNdkLib'.
> Process 'command '/usr/local/opt/android-ndk/ndk-build'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info
Closes #7935

Differential Revision: D3646120

Pulled By: bestander

fbshipit-source-id: c869ff4a2d3407643fdeec431f454071747eb429
  • Loading branch information...
1 parent dcd7591 commit 37df151562f905f1ff54bc753406a8ba10656ff3 @xinthink xinthink committed with Facebook Github Bot 9 Jul 30, 2016
Showing with 2 additions and 0 deletions.
  1. +2 −0 ReactAndroid/build.gradle
@@ -200,6 +200,8 @@ task buildReactNdkLib(dependsOn: [prepareJSC, prepareBoost, prepareDoubleConvers
task cleanReactNdkLib(type: Exec) {
commandLine getNdkBuildFullPath(),
+ "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
+ "THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
'-C', file('src/main/jni/react/jni').absolutePath,
@leeight
leeight Jul 30, 2016 Contributor

It looks like we need set "REACT_COMMON_DIR=$projectDir/../ReactCommon", after line 204.

'clean'
}

1 comment on commit 37df151

@leeight
Contributor

Still failed

Incremental java compilation is an incubating feature.
:ReactAndroid:cleanReactNdkLib
Android NDK: /xxx/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk: Cannot find module with tag 'cxxreact' in import path
/xxx/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk:42: *** Android NDK: Aborting.    .  Stop.
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make: Entering directory `/xxx/react-native/ReactAndroid/src/main/jni/react/jni'
make: Leaving directory `/xxx/react-native/ReactAndroid/src/main/jni/react/jni'
:ReactAndroid:cleanReactNdkLib FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:cleanReactNdkLib'.
> Process 'command '/xxx/adt-bundle-mac-x86_64-20140702/ndk/ndk-build'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
Please sign in to comment.