KjellConnelly / react-native-rate

Send your app users to Apple App Store, Google Play, Amazon, or other using the newest APIs
642 stars 101 forks source link

Android failed to build (error: method does not override or implement a method from a supertype) #1

Closed cjcheshire closed 5 years ago

cjcheshire commented 6 years ago

Thanks for writing this library!

I tried to use react-native link. Sadly our iOS isn't working right now so I successfully added it manually - all good :)

The weird one was native link did add references for android in the settings.gradle and build.gradle. These result in an error when building:

[…]/node_modules/react-native-rate/android/src/main/java/com/reactlibrary/RNRatePackage.java:19: error: method does not override or implement a method from a supertype

I noticed you said that android doesn't need to be manually added (so I removed and all good) so perhaps there is something that can be added to prevent these additions the link command adds?

KjellConnelly commented 6 years ago

@cjcheshire Thanks for using this module :) When I created it, I used another module that creates a basic iOS/Android (and I think windows) RN package. I didn't edit the android stuff at all, and don't remember if I even tested it or not.

I'll eventually get around to removing the native android code. Thank you for finding this! It'll be a few weeks probably (new baby in the house) before I can find the time to go through my code and fully make sure it's working properly again.

cjcheshire commented 6 years ago

Totally understand that. Mines one tomorrow. Many congratulations and thanks again for the library :)

buechner commented 6 years ago

@KjellConnelly So is this fixed now?

KjellConnelly commented 6 years ago

Idk. I looked at your reference and saw I merged a pull request. But I believe the android code is still all there. Never got around to deleting it since it wasn’t an issue on my current apps.

buechner commented 6 years ago

Ok, so if i understand it correctly: It is eventually not fixed, but the code is not used by default on Android anyways?

Thanks for the quick response. I would like to use your lib and just want to understand, if it is working on both platforms :) Thank you for sharing it.

KjellConnelly commented 6 years ago

@buechner The native Android module is never used as it's just boilerplate. So when you run the app on Android, it should use only the javascript code. When you run it on iOS, most of the code runs through javascript, though there is one feature which requires native objective-c code.

So it should work for both. If you use this module, it is possible that you will get the same error as cjcheshire did when you run on Android. I don't get that error, but it's possible that it's because I'm using RN from a year and a half ago along with all the build tools. If you do get that error, try removing the Android stuff and it might be gone.

I'm not very fluent with Android or building these RN modules. Kind of just learn as I build. Which is why I'm not 100% sure on what needs to be removed. Possibly just deleting the entire Android folder would be enough. I'm not sure though as my current apps have a lot of other bugs to iron out on Android first before the apps will even run (as I've been focusing on the iOS side of things only for the past several weeks)