【Android】Execution failed for task gl-react-native:buildEXGLLib
songxiaoliang opened this issue · comments
Execution failed for task ':gl-react-native:buildEXGLLib'.
Process 'command '/Users/uniqueway/Library/Android/sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2
The above error occurs when I run react-native run-android.
gl-react: 3.6.0
gl-react-native: 3.6.0
Looking forward to the author reply.
@gre hi,
I also found this error message, looking forward to how the author responded
Android NDK: android-9 is unsupported. Using minimum supported version android-14.
@gre All errors are as follows
➜ uniApp git:(updateFilterAndroid) react-native run-android
Scanning 753 folders for symlinks in /Users/uniqueway/uniApp/node_modules (21ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:extractProguardFiles
:app:preReleaseBuild
:app:preReleaseStagingBuild UP-TO-DATE
:gl-react-native:preBuild UP-TO-DATE
:gl-react-native:preReleaseBuild UP-TO-DATE
:gl-react-native:checkReleaseManifest
:gl-react-native:preDebugAndroidTestBuild UP-TO-DATE
:gl-react-native:preDebugBuild UP-TO-DATE
:gl-react-native:preDebugUnitTestBuild UP-TO-DATE
:gl-react-native:preReleaseUnitTestBuild UP-TO-DATE
:gl-react-native:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:gl-react-native:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:gl-react-native:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoDrawee101Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoFbcore101Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoFresco101Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoImagepipeline101Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoImagepipelineBase101Library UP-TO-DATE
:gl-react-native:prepareComFacebookFrescoImagepipelineOkhttp3101Library UP-TO-DATE
:gl-react-native:prepareComFacebookReactReactNative0443Library UP-TO-DATE
:gl-react-native:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:gl-react-native:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:gl-react-native:prepareReleaseDependencies
:gl-react-native:compileReleaseAidl UP-TO-DATE
:gl-react-native:compileReleaseNdk UP-TO-DATE
:gl-react-native:compileLint UP-TO-DATE
:gl-react-native:copyReleaseLint UP-TO-DATE
:gl-react-native:compileReleaseRenderscript UP-TO-DATE
:gl-react-native:generateReleaseBuildConfig
:gl-react-native:generateReleaseResValues UP-TO-DATE
:gl-react-native:generateReleaseResources UP-TO-DATE
:gl-react-native:mergeReleaseResources
:gl-react-native:processReleaseManifest UP-TO-DATE
:gl-react-native:processReleaseResources
:gl-react-native:generateReleaseSources
:gl-react-native:incrementalReleaseJavaCompilationSafeguard
:gl-react-native:createNativeDepsDirectories UP-TO-DATE
:gl-react-native:downloadJSCHeaders
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JavaScript.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSBase.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSContextRef.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSObjectRef.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSRetainPtr.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSStringRef.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/JSValueRef.h
Download https://raw.githubusercontent.com/WebKit/webkit/38b15a3ba3c1b0798f2036f7cea36ffdc096202e/Source/JavaScriptCore/API/WebKitAvailability.h
:gl-react-native:prepareJSC
:gl-react-native:buildEXGLLib
Android NDK: android-9 is unsupported. Using minimum supported version android-14.
make: Entering directory /Users/uniqueway/uniApp/node_modules/gl-react-native/android/src/main/jni' [x86] SharedLibrary : libjsc.so [x86] Prebuilt : libgnustl_shared.so <= <NDK>/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/ [armeabi-v7a] Compile++ : exgl <= EXGL.cpp [armeabi-v7a] Compile++ : exgl <= GLImages.cpp [armeabi-v7a] Compile : exgl <= EXJSUtils.c In file included from ./../../../../cpp/EXGL.cpp:1: ../../../../cpp/EXGL.h:9:10: fatal error: 'OpenGLES/ES2/gl.h' file not found #include <OpenGLES/ES2/gl.h> ^~~~~~~~~~~~~~~~~~~ In file included from ./../../../../cpp/EXJSUtils.c:1: In file included from ../../../../cpp/EXJSUtils.h:6: In file included from /Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/third-party-ndk/jsc/JavaScriptCore/JSValueRef.h:30: /Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/third-party-ndk/jsc/JavaScriptCore/WebKitAvailability.h:31:10: fatal error: 'AvailabilityMacros.h' file not found #include <AvailabilityMacros.h> ^~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [/Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/tmp/buildEXGLLib/local/armeabi-v7a/objs/exgl/__/__/__/__/cpp/EXJSUtils.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from ./../../../../cpp/GLImages.cpp:3: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/memory:72: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/wchar.h:37: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/time.h:33: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/time.h:37: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/select.h:36: /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/signal.h:96:18: error: expected ';' at end of declaration list sighandler_t sa_handler; ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi/asm/signal.h:85:22: note: expanded from macro 'sa_handler' #define sa_handler _u._sa_handler ^ In file included from ./../../../../cpp/GLImages.cpp:3: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/memory:72: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/iosfwd:40: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/postypes.h:40: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/include/cwchar:44: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/wchar.h:37: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/time.h:33: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/time.h:37: In file included from /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/sys/select.h:36: /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/signal.h:97:12: error: expected ')' void (*sa_sigaction)(int, struct siginfo*, void*); ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi/asm/signal.h:86:24: note: expanded from macro 'sa_sigaction' #define sa_sigaction _u._sa_sigaction ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/signal.h:97:10: note: to match this '(' void (*sa_sigaction)(int, struct siginfo*, void*); ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/signal.h:97:12: error: duplicate member '_u' void (*sa_sigaction)(int, struct siginfo*, void*); ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi/asm/signal.h:86:22: note: expanded from macro 'sa_sigaction' #define sa_sigaction _u._sa_sigaction ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/signal.h:96:18: note: previous declaration is here sighandler_t sa_handler; ^ /Users/uniqueway/Library/Android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi/asm/signal.h:85:20: note: expanded from macro 'sa_handler' #define sa_handler _u._sa_handler ^ 3 errors generated. make: *** [/Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/tmp/buildEXGLLib/local/armeabi-v7a/objs/exgl/__/__/__/__/cpp/GLImages.o] Error 1 1 error generated. make: *** [/Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/tmp/buildEXGLLib/local/armeabi-v7a/objs/exgl/__/__/__/__/cpp/EXGL.o] Error 1 ld: unknown option: -soname clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [/Users/uniqueway/uniApp/node_modules/gl-react-native/android/build/tmp/buildEXGLLib/local/x86/libjsc.so] Error 1 make: Leaving directory
/Users/uniqueway/uniApp/node_modules/gl-react-native/android/src/main/jni'
:gl-react-native:buildEXGLLib FAILED
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':gl-react-native:buildEXGLLib'.
Process 'command '/Users/uniqueway/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.
BUILD FAILED
first of all, again, this repository hosts the v2. you are refarring to the v3 which lives here: https://github.com/gre/gl-react
secondly, it seems like you are using outdated version, latest version of the v3 branch is v3.13.0, in this version gl-react-native does not have any native code and relies on react-native-webgl
. if you still want to use the v3, please upgrade to latest development of v3 as we might have fixed it in react-native-webgl
.
see how to setup this v3 here: https://github.com/gre/gl-react/blob/master/packages/gl-react-native/README.md#install