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.

Exception '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: expiresDate)' was thrown while invoking get on target RNCookieManagerIOS

See original GitHub issue

Bug

Just decide to move from react-native-cookies (3.2.0) to community version.

Exception '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: expiresDate)' was thrown while invoking get on target RNCookieManagerIOS with params (
    "http://****/mobile/",
    0,
    1522,
    1523
)
callstack: (
	0   CoreFoundation                      0x00007fff23c7127e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff513fbb20 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23d03ab1 _CFThrowFormattedException + 194
	3   CoreFoundation                      0x00007fff23d0e6a6 -[__NSDictionaryM setObject:forKey:].cold.2 + 38
	4   CoreFoundation                      0x00007fff23cd1d4f -[__NSDictionaryM setObject:forKey:] + 1071
	5   macroactive                         0x0000000109d78066 -[RNCookieManagerIOS get:useWebKit:resolver:rejecter:] + 1590
	6   CoreFoundation                      0x00007fff23c7820c __invoking___ + 140
	7   CoreFoundation                      0x00007fff23c753af -[NSInvocation invoke] + 319
	8   CoreFoundation                      0x00007fff23c75684 -[NSInvocation invokeWithTarget:] + 68
	9   macroactive                         0x0000000109ae6582 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2658
	10  macroactive                         0x0000000109aea6b7 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 791
	11  macroactive                         0x0000000109aea1c3 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 131
	12  macroactive                         0x0000000109aea139 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
	13  libdispatch.dylib                   0x00007fff5223e848 _dispatch_call_block_and_release + 12
	14  libdispatch.dylib                   0x00007fff5223f7b9 _dispatch_client_callout + 8
	15  libdispatch.dylib                   0x00007fff52245526 _dispatch_lane_serial_drain + 707
	16  libdispatch.dylib                   0x00007fff52245f5c _dispatch_lane_invoke + 388
	17  libdispatch.dylib                   0x00007fff5224fff9 _dispatch_workloop_worker_thread + 626
	18  libsystem_pthread.dylib             0x00007fff524636fc _pthread_wqthread + 290
	19  libsystem_pthread.dylib             0x00007fff52462827 start_wqthread + 15
)

RCTFatal
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread
"@react-native-community/react-native-cookies": "^1.1.0",

Installed via Pods.

Environment info

React native info output:

System:
    OS: macOS 10.15.2
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
    Memory: 1.51 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.11.3 - ~/.nvm/versions/node/v10.17.0/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 26, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.2 => 0.61.2

Library version: 1.1.0

Steps To Reproduce

  1. console.warn(await CookieManager.get(Env.ROOT_URL))

Describe what you expected to happen:

  1. No errors

Reproducible sample code

If I will pass useWebKit parameter as true, all is fine, but seems it’s not required parameter. Isn’t it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
safaiyehcommented, Jan 22, 2020

@klaevv could you make a separate issue for adding new fields. This issue will be fore the expireDate nil error.

0reactions
safaiyehcommented, Jan 28, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception '*** -[__NSDictionaryM setObject:forKey:]: object ...
Exception '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: expiresDate)' was thrown while invoking get on target ...
Read more >
ios - Fix a NSInvalidArgumentException: *** setObjectForKey ...
... setObjectForKey: object cannot be nil (key: updated_objectIDs)' *** First throw call stack: ( 0 CoreFoundation 0x000000010de39d4b __exceptionPreprocess ...
Read more >
react-native-cookies - Bountysource
... Exception '*** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: expiresDate)' was thrown while invoking get on target RNCookieManagerIOS ...
Read more >
what is "[__NSDictionaryM setObject:forKey:]: object cannot be ...
It looks like you have a corrupt profile. Try "profiles list" in the Terminal. Show more Less. View in context.
Read more >
object cannot be nil (key: adTagUrl)' error in IMA iOS SDK
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: adTagUrl)'.
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