tolu360 / react-native-paystack

React Native Wrapper for the Paystack Native Mobile SDKs
162 stars 46 forks source link

`method does not override or implement a method from a supertype` Error on RNPaystackPackage.java #2

Closed steveamaza closed 6 years ago

steveamaza commented 6 years ago

On installing the react-native-paystack Library, there is an error I can't seem to get past.

These are the two errors shown on Android Studio

Error:(16, 5) error: method does not override or implement a method from a supertype

Error:Execution failed for task ':react-native-paystack:compileReleaseJavaWithJavac'. Compilation failed; see the compiler error output for details.

Both of these errors seem to emanate from the createJSModules function as shown below


import ...

public class RNPaystackPackage implements ReactPackage {

    @Override     // <--- this module
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();
        modules.add(new RNPaystackModule(reactContext));
        return modules;
    }
}

How do I resolve this please 🙂

tolu360 commented 6 years ago

@steveamaza, if you are working with RN version >= 0.47, please pull in the latest version of this library (3.1.1) - just handled a breaking change introduced in 0.47.

Clean up your build by running - cd android && ./gradlew clean - try to build again. Let me know if the update resolves your issue.

steveamaza commented 6 years ago

Thank you! This works. I appreciate