How to get geolocation with Cordova Geolocation plugin from Android phone?

I am building an Android App with the Ionic Framework and I want to get the geolocation from my phone with Cordova Geolocation (

While testing the implementation in the browser (ionic serve), everything seems to work fine. But when I try to test it on the phone (Samsung Galaxy S6) the location will not be shown.

Unfortunately I can not see any errors for debugging with ionic cordova run android.

Does anyone has an idea how to fix this?

import { Component, OnInit } from '@angular/core';
import { Geolocation } from '@ionic-native/geolocation/ngx';
import * as moment from 'moment';
import { NativeGeocoder, NativeGeocoderOptions, NativeGeocoderResult } from '@ionic-native/native-geocoder/ngx';

  selector: 'app-tracking',
  templateUrl: './',
  styleUrls: ['./'],
export class TrackingPage implements OnInit {
  geoLatitude: number;
  geoLongitude: number;
  geoAccuracy: number;

  watchLocationUpdates: any;
  loading: any;
  isWatching: boolean;

  // Geocoder configuration
  geoencoderOptions: NativeGeocoderOptions = {
    useLocale: true,
    maxResults: 5

    private geolocation: Geolocation,
    private nativeGeocoder: NativeGeocoder
  ) { }

  getMoment() {
    return moment().milliseconds(0);

  ngOnInit() {
    document.addEventListener('deviceready', onDeviceReady, false);
    function onDeviceReady() {
        console.log('navigator.geolocation works well');

      // Start location update watch
      watchLocation() {
        let options = {
          maximumAge: 3600000,
          timeout: 3000,
          enableHighAccuracy: true,
        this.isWatching = true;
        this.watchLocationUpdates = this.geolocation.watchPosition();
        this.watchLocationUpdates.subscribe((resp) => {
          this.geoLatitude = resp.coords.latitude;
          this.geoLongitude = resp.coords.longitude;
          this.geoAccuracy = resp.coords.accuracy;
          timestamp: this.getMoment().format('x');
          // this.getGeoencoder(this.geoLatitude, this.geoLongitude);

      // Stop location update watch
      stopLocationWatch() {
        this.isWatching = false;
        console.log('this.isWatching = ', this.isWatching);

  <ion-toolbar color="primary">
      <div class="titleicon">
        <div class="logo-img"><img src="../assets/logo.png" width="120px" /></div>

<ion-content class="ion-padding" style="text-align: center;">
  <!-- *ngIf="geoLatitude" -->
      Address: {{ geoAddress }}
    </h1> -->
    <h4>Latitude: {{geoLatitude}}</h4>
    <h4>Longitude: {{geoLongitude}}</h4>
    <p>Genauigkeit: {{geoAccuracy}} m</p>

  <ion-button (click)="watchLocation()">
    Route starten
  <ion-button (click)="stopLocationWatch()" color="danger">
    Route beenden


Source: New feed
Source Url How to get geolocation with Cordova Geolocation plugin from Android phone?