question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building React Native from source failing on Android

See original GitHub issue

🐛 Bug Report

Following all the steps from RN documentation on building from source I am facing the following error on build, relating to LogSeverity.

> Task :ReactAndroid:buildReactNdkLib
make: Entering directory `/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'
[armeabi-v7a] Compile++ thumb: jscexecutor <= OnLoad.cpp
[armeabi-v7a] Prebuilt       : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/
[armeabi-v7a] Compile++ thumb: reactnativejni <= CatalystInstanceImpl.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= CxxModuleWrapper.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= JInspector.cpp
[armeabi-v7a] Compile++ thumb: reactnativejni <= JMessageQueueThread.cpp
In file included from ./CxxModuleWrapper.cpp:6:
In file included from ./CxxModuleWrapper.h:8:
In file included from ./CxxModuleWrapperBase.h:11:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/CxxModule.h:13:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:65:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Range.h:47:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/detail/RangeCommon.h:22:
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:1: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:31: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1191:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1209:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity);
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1214:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1220:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1226:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1270:41: error: unknown type name 'LogSeverity'
  void Init(const char* file, int line, LogSeverity severity,
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1277:30: error: use of undeclared identifier 'NUM_SEVERITIES'
  static int64 num_messages_[NUM_SEVERITIES];  // under log_mutex
                             ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1303:3: error: no matching constructor for initialization of 'google::LogMessage'
  LogMessage(__FILE__, __LINE__, severity).stream() << msg;
  ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1230:3: note: candidate constructor not viable: no known conversion from 'const int' to 'const google::CheckOpString' for 3rd argument
  LogMessage(const char* file, int line, const CheckOpString& result);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1202:3: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
  LogMessage(const char* file, int line);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1286:3: note: candidate constructor not viable: requires 1 argument, but 3 were provided
  LogMessage(const LogMessage&);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1362:47: error: unknown type name 'LogSeverity'
  ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1389:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity);
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1394:47: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity);
                                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1401:45: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity,
                                            ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1410:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity,
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1425:21: error: unknown type name 'LogSeverity'
  virtual void send(LogSeverity severity, const char* full_filename,
                    ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1447:31: error: unknown type name 'LogSeverity'
  static std::string ToString(LogSeverity severity, const char* file, int line,
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1470:44: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity);
                                           ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1483:43: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity,
                                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/CxxModuleWrapper.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ./CatalystInstanceImpl.cpp:6:
In file included from ./CatalystInstanceImpl.h:11:
In file included from ./CxxModuleWrapper.h:8:
In file included from ./CxxModuleWrapperBase.h:11:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/cxxreact/../cxxreact/CxxModule.h:13:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:65:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Range.h:47:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/detail/RangeCommon.h:22:
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:1: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:31: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1191:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1209:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity);
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1214:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1220:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1226:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1270:41: error: unknown type name 'LogSeverity'
  void Init(const char* file, int line, LogSeverity severity,
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1277:30: error: use of undeclared identifier 'NUM_SEVERITIES'
  static int64 num_messages_[NUM_SEVERITIES];  // under log_mutex
                             ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1303:3: error: no matching constructor for initialization of 'google::LogMessage'
  LogMessage(__FILE__, __LINE__, severity).stream() << msg;
  ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1230:3: note: candidate constructor not viable: no known conversion from 'const int' to 'const google::CheckOpString' for 3rd argument
  LogMessage(const char* file, int line, const CheckOpString& result);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1202:3: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
  LogMessage(const char* file, int line);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1286:3: note: candidate constructor not viable: requires 1 argument, but 3 were provided
  LogMessage(const LogMessage&);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1362:47: error: unknown type name 'LogSeverity'
  ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1389:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity);
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1394:47: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity);
                                              ^
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/OnLoad.cpp:9:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/jsiexecutor/jsireact/JSIExecutor.h:8:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/jsiexecutor/jsireact/JSINativeModules.h:11:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/jsi/../cxxreact/ModuleRegistry.h:12:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/jsi/../cxxreact/JSExecutor.h:11:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/../ReactCommon/jsi/../cxxreact/NativeModule.h:12:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/dynamic.h:65:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/Range.h:47:
In file included from /Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/folly/folly/detail/RangeCommon.h:22:
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:1: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1401:45: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity,
                                            ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:661:31: error: unknown type name 'LogSeverity'
LogSeverity NormalizeSeverity(LogSeverity s);
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1410:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity,
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1425:21: error: unknown type name 'LogSeverity'
  virtual void send(LogSeverity severity, const char* full_filename,
                    ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1447:31: error: unknown type name 'LogSeverity'
  static std::string ToString(LogSeverity severity, const char* file, int line,
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1191:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1470:44: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity);
                                           ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1209:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity);
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1483:43: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity,
                                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1214:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1220:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1226:42: error: unknown type name 'LogSeverity'
  LogMessage(const char* file, int line, LogSeverity severity,
                                         ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1270:41: error: unknown type name 'LogSeverity'
  void Init(const char* file, int line, LogSeverity severity,
                                        ^
20 errors generated.
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1277:30: error: use of undeclared identifier 'NUM_SEVERITIES'
  static int64 num_messages_[NUM_SEVERITIES];  // under log_mutex
                             ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1303:3: error: no matching constructor for initialization of 'google::LogMessage'
  LogMessage(__FILE__, __LINE__, severity).stream() << msg;
  ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1230:3: note: candidate constructor not viable: no known conversion from 'const int' to 'const google::CheckOpString' for 3rd argument
  LogMessage(const char* file, int line, const CheckOpString& result);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1202:3: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
  LogMessage(const char* file, int line);
  ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1286:3: note: candidate constructor not viable: requires 1 argument, but 3 were provided
  LogMessage(const LogMessage&);
  ^
make: *** [/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/reactnativejni/CatalystInstanceImpl.o] Error 1
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1362:47: error: unknown type name 'LogSeverity'
  ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr,
                                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1389:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity);
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1394:47: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity);
                                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1401:45: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity,
                                            ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1410:41: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity,
                                        ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1425:21: error: unknown type name 'LogSeverity'
  virtual void send(LogSeverity severity, const char* full_filename,
                    ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1447:31: error: unknown type name 'LogSeverity'
  static std::string ToString(LogSeverity severity, const char* file, int line,
                              ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1470:44: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity);
                                           ^
/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/third-party-ndk/glog/exported/glog/logging.h:1483:43: error: unknown type name 'LogSeverity'
GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity,
                                          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/jscexecutor//Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/OnLoad.o] Error 1
make: Leaving directory `/Users/grzegorzpawlik/DEV/PP/hive-soaring-sparrow/node_modules/react-native/ReactAndroid/src/main/jni/react/jni'

> Task :ReactAndroid:buildReactNdkLib FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '/Users/grzegorzpawlik/Library/Android/sdk/ndk-bundle/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. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s
737 actionable tasks: 16 executed, 721 up-to-date
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Follow the instructions from: https://facebook.github.io/react-native/docs/building-from-source

Expected Behavior

React Native building from source correctly on Android.

Code Example

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
      Memory: 56.52 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
      Yarn: 1.15.0 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Android Studio: 3.0 AI-171.4443003
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      @storybook/react-native: ^4.1.11 => 4.1.11
      react: ^16.8.5 => 16.8.5
      react-native: ^0.59.3 => 0.59.3
    npmGlobalPackages:
      react-native-generate: 0.1.0
      react-native-git-upgrade: 0.2.7

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Kudocommented, Apr 9, 2019

It seems the issue happens sometimes especially for very first time setup. A possible workaround for this: remove node_modules/react-native/ReactAndroid/build and rebuild. I guess there are some race conditions in gradle copy task but not have a reliable way to reproduce unfortunately.

0reactions
hanhuizhucommented, Jan 9, 2020

it works for me @Kudo

Read more comments on GitHub >

github_iconTop Results From Across the Web

[FIXED] Android build failures `No matching variant of ... - GitHub
This event resulted in build failures for Android on several users as they ended up downloading the wrong React Native version ( 0.71.0-rc0 ......
Read more >
React Native Android build failure with different errors without ...
Reason for Failures : The build failures for Android was due to the publish of the React Native version 0.71.0-rc0 to Maven and...
Read more >
How to fix all build errors in react native(Android specific).
1. Always read the documentation of a package or its npm repository page for how to correctly install a package · 2. ·...
Read more >
How to Build from Source - React Native
You will need to build React Native from source if you want to work on a new feature/bug fix, try out the latest...
Read more >
Building React Native from source - GitHub Pages
You will need to build React Native from source if you want to work on a new feature/bug fix, try out the latest...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found