title: React-native iOS, Async storage error: "Invalid key - must be at least one character. Key: "
body: <p>I want to store a JSON object using Async Storage for my react-native app in android and iOS. I stringify the object and store it using Async Storage as it can only store strings. The app works fine in android but throws an error in iOS. The error is as follows:</p>
  
  <pre><code>Error: {
    key = "";
    message = "Invalid key - must be at least one character.  Key: ";
  }
  
  RCTMakeAndLogError
      RCTUtils.m:394
  RCTErrorForKey
  -[RCTAsyncLocalStorage _writeEntry:changedManifest:]
  -[RCTAsyncLocalStorage multiSet:callback:]
  __invoking___
  -[NSInvocation invoke]
  -[NSInvocation invokeWithTarget:]
  -[RCTModuleMethod invokeWithBridge:module:arguments:]
  facebook::react::RCTNativeModule::invokeInner(unsigned int, folly::dynamic const&amp;&amp;)
  facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&amp;&amp;, int)::$_0::operator()() const
  invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&amp;&amp;, int)
  _dispatch_call_block_and_release
  _dispatch_client_callout
  _dispatch_queue_serial_drain
  _dispatch_queue_invoke
  _dispatch_queue_override_invoke
  _dispatch_root_queue_drain
  _dispatch_worker_thread3
  _pthread_wqthread
  start_wqthread
  </code></pre>
  
  <p>My search led me to the iOS implementation of Async Storage for react-native <a href="https://github.com/facebook/react-native/blob/master/React/Modules/RCTAsyncLocalStorage.m#L307" rel="nofollow noreferrer">here</a> but I have no knowledge about Objective-C or Swift. Would be grateful if someone can help me out here. Thanks! </p>
  
  <p><strong>UPDATE</strong><br>
  I use AsyncStorage to store the values in a JS file. </p>