react-native-background-geolocation: package com.transistorsoft.rnbackgroundgeolocation does not exist

package com.mysampleapp;

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.transistorsoft.rnbackgroundgeolocation.*;
import com.transistorsoft.rnbackgroundfetch.RNBackgroundFetchPackage;

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 RNBackgroundGeolocation(),
         new RNBackgroundFetchPackage(),
          new MainReactPackage()
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

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

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

This is my  mainapplication.java file source code. When i remove these lines 
import com.transistorsoft.rnbackgroundgeolocation.*;
import com.transistorsoft.rnbackgroundfetch.RNBackgroundFetchPackage;

  new RNBackgroundGeolocation(),
 new RNBackgroundFetchPackage(),

Able to compile but after adding these lines not able to compile. I did manual setup.

Please help.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 53 (25 by maintainers)

Most upvoted comments

I added

implementation project(‘:react-native-background-geolocation’) implementation project(‘:react-native-background-fetch’)

in app/build.gradle and it is working now