rnc-archive / react-native-webgl

DEPRECATED: use expo-gl – Implements WebGL for react-native
296 stars 73 forks source link

Error on build, react-native 0.60 #93

Closed vadhack closed 5 years ago

vadhack commented 5 years ago

Please, can someone help me? Error on build, react-native 0.60

Environment info

React native error output:

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

2: Task failed with an exception.

aevzp commented 5 years ago

The same problem RN 0.59.9

AMARAYANK commented 5 years ago

I'm also facing the same problem RN 0.60.3

ghost commented 5 years ago

Looks like the << operator needs to be replaced with doLast in build.gradle

https://stackoverflow.com/a/55793096

vadhack commented 5 years ago

thanks,

in "/node_modules/react-native-webgl/android/build.gradle

i changed this:

task prepareJSC(dependsOn: downloadJSCHeaders) << { copy { from {downloadJSCHeaders.dest} include 'jni/*/.so', '.h', 'Android.mk' filesMatching('.h', { fname -> fname.path = "JavaScriptCore/${fname.path}"}) into "$thirdPartyNdkDir/jsc"; } }

by this:

task prepareJSC(dependsOn: downloadJSCHeaders) { doLast { copy { from {downloadJSCHeaders.dest} include 'jni/*/.so', '.h', 'Android.mk' filesMatching('.h', { fname -> fname.path = "JavaScriptCore/${fname.path}"}) into "$thirdPartyNdkDir/jsc"; } } }

then worked, but i got other errors related to gradle version:

Task :react-native-webgl:buildRNWebGLLib FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings 56 actionable tasks: 56 executed Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

ghost commented 5 years ago

In react-native-webgl/android/src/main/jni/Application.mk, if you change APP_STL to _APP_STL := c++shared, and remove the _NDK_TOOLCHAINVERSION := 4.9 line, it seems to compile. Not sure what this breaks though.

Bartson commented 5 years ago

I had the same error. I did everything that is contained in this thread but below error occurred. Did you guys linked library? In RN 0.6 I don't really know what should I do when library is not supporting autolinking.


-----------
* Where:
Build file '/Users/admin/Desktop/react-native-apps/GLTest/node_modules/react-native-webgl/android/build.gradle' line: 51

* What went wrong:
A problem occurred evaluating project ':react-native-webgl'.
> No such property: sdkHandler for class: com.android.build.gradle.LibraryPlugin``
skizzo commented 5 years ago

Any updates on this? I'm on RN 0.59.10 and can't build the project for Android.

cesarhilario commented 5 years ago

Same error for me RN 0.60.4

gre commented 5 years ago

we can continue the discussion on #95 , many issues was recently addresses but there are now some remaining issues mentionned in #95