MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.12k stars 1.09k forks source link

NDK ISSUE #3355

Open ShreyashSiddharth opened 2 years ago

ShreyashSiddharth commented 2 years ago

Hi I am trying to build metamask mobile through android studio following all the Readme steps on my local machine still getting this error

Execution failed for task ':ReactAndroid:buildReactNdkLib'.

Process 'command '/home/shreyash/Android/Sdk/ndk/17.2.4988734/ndk-build'' fin shed with non-zero exit value 2

PrimarchAlpharius commented 2 years ago

There's probably a missing package not mentioned in the docs. Try looking around the error, it should mention it by name. In my case I needed to install libncurses5 I think.

rajtejani commented 2 years ago

Facing the same issue.

make: Entering directory `/Volumes/WORKSPACE/Live Projects/metamask-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.    
Android NDK: NDK_PROJECT_PATH==null.  Please explicitly set APP_BUILD_SCRIPT.    
make: Leaving directory `/Volumes/WORKSPACE/Live Projects/metamask-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'

Is there a problem with APP_PLATFORM_PATH and NDK_PROJECT?

ShreyashSiddharth commented 2 years ago

libncurses5 is not mentioned in docs and it causes issues on multiple systems

rajtejani commented 2 years ago

Facing the same issue.

make: Entering directory `/Volumes/WORKSPACE/Live Projects/metamask-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.    
Android NDK: NDK_PROJECT_PATH==null.  Please explicitly set APP_BUILD_SCRIPT.    
make: Leaving directory `/Volumes/WORKSPACE/Live Projects/metamask-mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'

Is there a problem with APP_PLATFORM_PATH and NDK_PROJECT?

The issue with me was that there was space in the folder name "Live Projects" so it was causing the problem. When I moved my project to seprate directory having no spaces in folder names then it started working.

gantunesr commented 2 years ago

Hey @ShreyashSiddharth and @rajtejani, can you try building with the latest version of the code?

inapeace0 commented 2 years ago

Hi, I had the same issue while I run the latest code.

> Task :ReactAndroid:buildReactNdkLib FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
534 actionable tasks: 8 executed, 526 up-to-date
E:/2022.01/peronio-mobile/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/FileUtil.cpp:37:14: error: no matching function for call to 'wrapNoInt'
  return int(wrapNoInt(open, name, flags, mode));
             ^~~~~~~~~
E:/2022.01/peronio-mobile/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly\folly/detail/FileUtilDetail.h:34:9: note: candidate template ignored: couldn't infer template argument 'F'
ssize_t wrapNoInt(F f, Args... args) {
        ^
1 error generated.
make: *** [D:/Sdk/ndk/21.0.6113669/build//../build/core/build-binary.mk:478: E:\2022.01\peronio-mobile\node_modules\react-native\ReactAndroid\build\tmp\buildReactNdkLib/local/armeabi-v7a/objs/folly_json/folly/FileUtil.o] Error 1
make: *** Waiting for unfinished jobs....

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command 'D:\Sdk\ndk\21.0.6113669\ndk-build.cmd'' finished with non-zero exit value 2

Any solution for it???