staltz / react-native-node

Run a separate Node.js process behind a React Native app
MIT License
1.12k stars 33 forks source link

method does not override or implement a method from a supertype Error #6

Closed prashant45 closed 7 years ago

prashant45 commented 7 years ago

While using this library for a simple fs.readFile method in ./background, I am getting this error while building the project. I followed all the instruction.

C:\path\to\project\node_modules\react-native-node\android\src\main\java\com\staltz\reactnativenode\RNNodePackage.java:23: error: method does not overr
ide or implement a method from a supertype
    @Override                                                  
    ^
1 error
:react-native-node:compileReleaseJavaWithJavac FAILED

Project specs

"react": "^16.0.0-alpha.12",
"react-native": "^0.47.1",
"react-native-node": "^1.1.2"

Any clue ?

staltz commented 7 years ago

Hmm this is Java error, and the only thing that stands out in my perspective is react-native v0.47. This library was tested with react-native v0.46 projects.

Is your project small enough that you can rewrite it with v0.46 and check if that is the root cause?

nomoreboredom commented 7 years ago

I am currently trying to run core node.js modules on RN and using 0.47.1, that

@Override 

is deprecated for RN 0.47.1

aschrijver commented 7 years ago

You can safely remove the the method createJSModule(). It has been removed in latest RN. See breaking changes: https://github.com/facebook/react-native/releases/tag/v0.47.0

staltz commented 7 years ago

This should be solved now that react-native-node v2.0.0 is updated for React Native v0.48