Android build error with [email protected]
I get this error when building with [email protected]:
node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:64: error: method does not override or implement a method from a supertype
@Override
^
1 error
I'm having the same error.
Are you using other external packages that require push? Like Firebase?
@rturk, good idea, I disabled all other external packages. Unfortunately the error is still present.
Same. I'm encountering this error with rn 0.30.0 and 2.0.2 of the app. Has anyone gotten this to work correctly?
same here
Rolling back to 2.0.1 fixed it for now, while still being on rn 0.30.0
"react-native-push-notification": "2.0.1"
Had this problem also, had to
npm cache clear
rm -Rf node_modules
npm install
After than 2.0.2 + rn 0.30.0 works properly.
I'm having the same error :( : "react-native": "^0.30.0", "react-native-push-notification": "^2.0.1"
error: method does not override or implement a method from a supertype @Override ^
Did you guys all upgrade from a previous version of RN? For me the error was fixed after I ran react-native upgrade, and made sure all files in android/ were up-to-date.
I tried [email protected] with 2.0.2 (commit #0b019670) and it requires to remove the @Override keyword and leave the onNewIntent function where it is.
Re-running the upgrade, and ensuring I got everything, worked for me.
Everything is updated and this is the error I get trying to compile it with [email protected]:
./node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:64: error: method does not override or implement a method from a supertype
@Override
^
1 error
:react-native-push-notification:compileReleaseJavaWithJavac FAILED
I found out that my configuration in ./android/build.gradle was not correctly set. It needs to be set to:
url "$rootDir/../node_modules/react-native/android"
instead of
url "$projectDir/../../node_modules/react-native/android"
I have the same issue on 0.33-rc but it works on 0.32. Not sure what it's coming from...
I am getting this with RN0.33.0 and neither rn upgrade nor nuking node_modules solved this.
I've solved this by opening project in Android studio. Open RNPushNotification.java. Hit Ctrl+I (Implement methods). Choose onActivityResult. Delete former onActivityResult and save.
I looked at your commit - as far as I can see, nothing was actually changed except some new lines. Not sure how that is going to fix this issue?
@julienvincent that is actually the strange part. Compiler was complaining about not implementing method onActivityResult. So I've opened Android Studio -> implements method. It created new method onActivityResult and I deleted old declaration. Compiler was happy. And just after that I've realised the method declaration is same, so actually only empty lines were added. Very strange. However when I install module from npm, it happens again.
/Users/finch/dev/mapilary/Courier/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:30: error: RNPushNotification is not abstract and does not override abstract method onActivityResult(Activity,int,int,Intent) in ActivityEventListener
public class RNPushNotification extends ReactContextBaseJavaModule implements ActivityEventListener {
^
../node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java:168: error: method does not override or implement a method from a supertype
@Override
^
2 errors
Ok. I've found that npm version is not same as master on github (but version numbers are the same). I've only checked build.gradle and it differs. Maybe that is the reason. Installed from github instead of npm and no compilation error occured.
So I would say npm version should be reuploaded.
The github version would differ due to the repo owner doing additional work on the project since last release. But I agree, it would be nice if @zo0r could release a new patch version to fix this problem. In the meantime I have found that using 2.0.1 does indeed fix this as mentioned by @skunkworker.