transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.65k stars 426 forks source link

Getting a crash on release builds in iOS only #565

Closed milesegan closed 5 years ago

milesegan commented 6 years ago

Your Environment

Expected Behavior

The app shouldn't crash.

Actual Behavior

The app crashes on startup.

Steps to Reproduce

Our app crashes right after launch, but only in release builds.

Context

This crash only happens in release builds and only started happening after we upgraded to the most recent version of react native. We've been using it with older versions of RN without issues. The stack trace isn't very useful here unfortunately. It looks to me like it might be some kind of memory corruption issue.

Debug logs

Platform: ios Version: 2.3 (440) Issue #: 3 Issue ID: 5ba0f2c8f8b88c2963544e8c Session ID: 06ca955927cf40f08e925a430a920230_DNE_0_v2 Date: 2018-09-18T14:01:00Z OS Version: 11.4.1 (15G77) Device: iPhone 8 Plus RAM Free: 27.7% Disk Free: 83.2%

8. Crashed: com.transistorsoft.TSLocationManager

0 libobjc.A.dylib 0x182d897f4 objc_object::release() + 16 1 libobjc.A.dylib 0x182d8a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844 2 libdispatch.dylib 0x1834d3060 _dispatch_last_resort_autorelease_pool_pop + 36 3 libdispatch.dylib 0x1834e3b24 _dispatch_queue_invoke$VARIANT$armv81 + 372 4 libdispatch.dylib 0x1834e449c _dispatch_root_queue_drain_deferred_wlh$VARIANT$armv81 + 332 5 libdispatch.dylib 0x1834ec46c _dispatch_workloop_worker_thread$VARIANT$armv81 + 612 6 libsystem_pthread.dylib 0x1837d7e70 _pthread_wqthread + 860 7 libsystem_pthread.dylib 0x1837d7b08 start_wqthread + 4

christocracy commented 5 years ago

@Peeeep Try installing the plugin from git using the following url:

npm install https://github.com/transistorsoft/react-native-background-geolocation.git#ios-sync-bug
Peeeep commented 5 years ago

I've only played around with the Simulator, but unfortunately, I can get it to crash quite easily now... (I believe I wasn't able to crash it in the Simulator before, but hadn't tried very hard tbh).

I've pushed some try/catch blocks to the repo, maybe this can help a bit... Will get back to you with some real device data plus a stacktrace by tomorrow (I'm UTC+2), please let me know if there is anything else I can help with!

christocracy commented 5 years ago

Your installed version is 2.14.2?

Peeeep commented 5 years ago

Yes, the ios-sync-bug branch.

Peeeep commented 5 years ago

Sorry for the late reply, but this now works perfectly for us! You got yourself a fully satisfied paying customer, thank you!

pomozoff commented 3 years ago

@christocracy, I have the same crashlog, but my project is different. I'll very much appreciate if you provide a hint of what did you fix in iOS code to get rid of this crash?

christocracy commented 3 years ago

@pomozoff This closed issue is over 2 years old and you're providing no information. Post a new issue.