capacitor-community / background-geolocation

A Capacitor plugin that sends you geolocation updates, even while the app is in the background.
MIT License
180 stars 56 forks source link

Error: "BackgroundGeolocation" plugin is not implemented on android #28

Closed gine closed 3 years ago

gine commented 3 years ago

Describe the bug Starting the geolocation i recive in Logcat this error

E/Capacitor/Console: File: http://localhost/static/js/4.b5a04f7e.chunk.js - Line 2 - Msg: Uncaught (in promise) Error: "BackgroundGeolocation" plugin is not implemented on android

To Reproduce Follow your step to install it and this howto to solve a compilation problem

Smartphone (please complete the following information):

gine commented 3 years ago

Manually adding add(BackgroundGeolocation.class); on

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Add this line
      add(BarcodeScanner.class);
      add(BackgroundGeolocation.class);
    }});
  }
}

it start to work... maybe i had this problem because i had the overide here for BarcodeScanner?

diachedelic commented 3 years ago

So everything is OK?