Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Crash when start the app #60

Closed
KarlosQ opened this issue Apr 5, 2017 · 2 comments
Closed

[iOS] Crash when start the app #60

KarlosQ opened this issue Apr 5, 2017 · 2 comments

Comments

@KarlosQ
Copy link

KarlosQ commented Apr 5, 2017

Environment

  • Plugin version: 0.2.0-alpha.7
  • Platform: iOS
  • OS version: 10.2
  • Device manufacturer and model: iPhone 5 (simulator)
  • React Native version: 0.42

Context

When I start the app the line 112 of LocationManager.m throw a error

The line:

locationManager.allowsBackgroundLocationUpdates = YES;

The error:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient)'

*** First throw call stack:
(
0 CoreFoundation 0x06139bf2 __exceptionPreprocess + 194
1 libobjc.A.dylib 0x04c38e66 objc_exception_throw + 52
2 CoreFoundation 0x0613dd12 +[NSException raise:format:arguments:] + 130
3 Foundation 0x04838af4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 94
4 CoreLocation 0x01880ad8 CLClientGetCapabilities + 12072
7 libobjc.A.dylib 0x04c4e36b +[NSObject new] + 69prepareModulesWithDispatchGroup:]_block_invoke + 139
13 libdispatch.dylib 0x06f7d396 _dispatch_call_block_and_release + 15
14 libdispatch.dylib 0x06fa8cc3 _dispatch_client_callout + 14
15 libdispatch.dylib 0x06f87c55 _dispatch_main_queue_callback_4CF + 662
16 CoreFoundation 0x060fa05e CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 14
17 CoreFoundation 0x060bc8df __CFRunLoopRun + 2319
18 CoreFoundation 0x060bbd5b CFRunLoopRunSpecific + 395
19 CoreFoundation 0x060bbbbb CFRunLoopRunInMode + 123
20 GraphicsServices 0x0927ab4c GSEventRunModal + 177
21 GraphicsServices 0x0927a9c7 GSEventRun + 80
22 UIKit 0x02ebbff3 UIApplicationMain + 148
24 libdyld.dylib 0x06fe3799 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@MilosR
Copy link

MilosR commented May 2, 2017

You need to add following into your projects Info.plist file

UIBackgroundModes "location"
NSLocationAlwaysUsageDescription "your description"

UIBackgroundModes must be an array of strings, where one string is required - "location", so source code of Info.plist should look like:

...

<key>UIBackgroundModes</key>
<array>
  <string>location</string>
</array>

...

<key>NSLocationAlwaysUsageDescription</key>
<string>App requires background tracking</string>

...

@mauron85
Copy link
Owner

mauron85 commented Oct 4, 2017

This is already mentioned in README section iOS Setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants