question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS crashes on BackgroundGeolocation.start()

See original GitHub issue

When trying to start the geolocation, the app crashes without any message, error handling or anything else.

Your Environmentnumeric version changes over the time -->

  • Plugin version: 3.0.3 (newest)
  • Platform: iOS
  • OS version: 12
  • Device manufacturer and model: iPhone 6, iOS 12
  • Running in Simulator: Not possible
  • Cordova version (cordova -v): newest (already reinstalled)
  • Cordova platform version (cordova platform ls): newest (already reinstalled)
  • Plugin configuration options:
  • Link to your project:

Context

Im just calling the start method with all granted permissions. When starting the app, it crashes instantly after calling BackgroundGeolocation.start(); I´ve tried everything but ios debugging with javascript, cordova and ionic is like hell. Thus im trying to fix that issue with your help, to see if there are any methods to avoid this crash. The ionicerrorhandler isn´t even called, because that should normally send a report to sentry (what it doesn´t do)

Things i´ve tried:

  • Running on different devies (ios 12, 13)
  • granting permissions manually
  • remove and add plattform
  • remove and add plugin

P.S. on android everything works fine.

The code im using:

BackgroundGeolocation.configure({
				locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
				desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
				stationaryRadius: 1,
				distanceFilter: 30,
				interval: 1000,
				fastestInterval: 1000,
				activitiesInterval: 1000,
				saveBatteryOnBackground: true,
				maxLocations: 1,
				activityType: "AutomotiveNavigation",
				debug: false,
			});
			this.startGettingLocations(); // registers an "on('location')" listener

			await this.log("Configure Done"); // pops up
			BackgroundGeolocation.start(); // Crashes
			await this.log("Background location started.");

Expected Behavior

The Geolocator should start…

Actual Behavior

Crash

Possible Fix

/

Steps to Reproduce

  1. Call BackgroundGeolocation.start();

Context

Already tried many different things, and after a week trying to debug with mac os (virtually, dedicated, physically, virtualbox) im trying this way

Debug logs

No logs.

If you need any more information: im going to provide it asap.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
MKHSKYcommented, Feb 11, 2020

As already mentioned above, setting the information via config.xml worked. If somebody is facing the same issue, the first approach should be debugging the app with XCode directly.

But i set the config things like shown below <config><widget><platform name="ios">

        <config-file parent="NSBluetoothAlwaysUsageDescription" platform="ios" target="*-Info.plist">
            <string>Yeet your information to ios, even if its not shown ANYWHERE f*kin apple</string>
        </config-file>
        <config-file parent="NSLocationAlwaysUsageDescription" platform="ios" target="*-Info.plist">
            <string>Yeet your information to ios, even if its not shown ANYWHERE f*kin apple</string>
        </config-file>
        <config-file parent="NSLocationWhenInUseUsageDescription" platform="ios" target="*-Info.plist">
            <string>Yeet your information to ios, even if its not shown ANYWHERE f*kin apple</string>
        </config-file>
        <config-file parent="NSMotionUsageDescription" platform="ios" target="*-Info.plist">
            <string>Yeet your information to ios, even if its not shown ANYWHERE f*kin apple</string>
        </config-file>```
2reactions
MKHSKYcommented, Dec 11, 2019

hi there, i managed to fix the issue above by setting alle correct Information in the plist file. I debugged it with xcode, that worked very well.

Im not using thhe config settings of the plugin and wrote it in the config xml by myself

So i think your issue isnt related to this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

app crash on BackgroundGeolocation.start() #452 - GitHub
start() ", the app builds well without crashing but when I make the method active, the app crashes. Anyone found a working solution?...
Read more >
iOS crashes on BackgroundGeolocation.start() #645 - Issuehunt
iOS crashes on BackgroundGeolocation.start() #645 ... When trying to start the geolocation, the app crashes without any message, error handling or anything else....
Read more >
crash app on android 8.1.0 when background geolocation is ...
crash app on android 8.1.0 when background geolocation is started. ... + ' Longitude ' + location.longitude, trigger: { at: new Date(new Date()....
Read more >
react-native-mauron85-background-geolocation/README.md
330 ; 331, Start background geolocation. ; 332 ; 333, ### stop() ; 334, Platform: iOS, Android.
Read more >
Mauron85/cordova-plugin-background-geolocation app ...
Mauron85/cordova-plugin-background-geolocation app crashes when start service · cordova · rahulsharma841990 November 16, 2020, 8:09pm #1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found