React-native-contacts: error: method does not override or implement a method from a supertype

Created on 3 Jun 2017  路  8Comments  路  Source: morenoh149/react-native-contacts

Hi,
While trying to compile my project I get the following error.

MainApplication.java:42: error: method does not override or implement a method from a supertype

package com.mypackage;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.rt2zz.reactnativecontacts.ReactNativeContacts;   // <--- import module!

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }

  @Override
        protected List<ReactPackage> getPackages() {
          return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new ReactNativeContacts()   // <--- and add package
          );
        }
}

react-native-cli: 2.0.1

react-native: 0.44.2

react-native-contacts installed using npm

All 8 comments

rnpm-install info Android module react-native-contacts is already linked
rnpm-install info iOS module react-native-contacts is already linked

Its showing that I have the project linked - but I don't think its working properly. Anyone facing the same issue?

Ok solved problem was at my end. Sorry! I misread the conf. Its working

I have the same issue. How have you solved?

@salisaim How'd you fix it?

Seems like removing

    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return null;
    }

from ReactNativeContacts fixes this ?

this removal was added in react-native-contacts version 0.9.1 for RN 0.47.0+ compatibility. See https://github.com/rt2zz/react-native-contacts/pull/205

@morenoh149 my bad, 0.9 isn't in releases - was looking out for this
https://github.com/rt2zz/react-native-contacts/releases

@kyle-ssg look out on npm. I find it cumbersome to use the github releases.

Was this page helpful?
0 / 5 - 0 ratings