rnc-archive / react-native-webgl

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

RNWebGLView.java:50: error: cannot find symbol #35

Closed teilala closed 6 years ago

teilala commented 6 years ago

I always got this error , when i build for android on windows ,

local.properties:

ndk.dir=E\:\\android\\android-ndk-r10d-windows-x86_64\\android-ndk-r10d

and settings.gradle:

`rootProject.name = 'swag' include ':react-native-camera' project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')

include ':app' include ':react-native-camera' project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')

include ':react-native-webgl' project(':react-native-webgl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webgl/android')

include ':RNWebGL' project(':RNWebGL').projectDir = file('../node_modules/react-native-camera/android')`

build error:

`F:\rn\swag\swag\node_modules\react-native-webgl\android\src\main\java\fr\greweb\ rnwebgl\RNWebGLView.java:50: error: cannot find symbol ctxId = RNWebGLContextCreate(reactContext.getJavaScriptContext()); ^ symbol: method getJavaScriptContext() location: variable reactContext of type ReactContext Note: F:\rn\swag\swag\node_modules\react-native-webgl\android\src\main\java\fr\g reweb\rnwebgl\RNWebGLViewManager.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error :react-native-webgl:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

BUILD FAILED`

epochrion commented 6 years ago

What version of React Native are you using? If it is >= 0.50.1, then see this commit.

Specifically, change    reactContext.getJavaScriptContext() to be the following instead    reactContext.getJavaScriptContextHolder().get() and see if that fixes the error.

kelset commented 6 years ago

Try using master, I've already submitted & @gre merged this PR https://github.com/react-community/react-native-webgl/pull/32

gre commented 6 years ago

oops i need to do a new release

teilala commented 6 years ago

i resolve the issue .thanks guys Specifically, change reactContext.getJavaScriptContext() to be the following instead reactContext.getJavaScriptContextHolder().get() and see if that fixes the error.

robertjuh commented 6 years ago

in the code it is: reactContext.getJavaScriptContextHolder().get()

but i still get the error.

My package.json=

{ "name": "example", "version": "0.1.0", "private": true, "devDependencies": { "babel-preset-react-native-stage-0": "^1.0.1" }, "scripts": { "start": "react-native start", "android": "react-native run-android", "ios": "react-native run-ios" }, "dependencies": { "angle-normals": "^1.0.0", "bunny": "^1.0.1", "gl-mat4": "^1.1.4", "react": "16.0.0-alpha.5", "react-native": "0.49.3", "react-native-webgl": "file:..", "react-navigation": "1.0.0-beta.12", "regl": "^1.3.0", "three": "0.85.x" } }

and i do "react-native run android" from the "example" folder

reza7rm commented 6 years ago

now in react native version 0.49 you need to revert the change and change reactContext.getJavaScriptContextHolder().get() to reactContext.getJavaScriptContext()

maybe it is time to have two different versions?