title: Flutter: *** 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]
body: <p>I am pretty new to coding, but working on a flutter app and trying to integrate the ability to share images to Instagram Stories using the <a href="https://pub.dev/packages/social_share" rel="nofollow noreferrer">Social Share</a> package. Everything works fine to generate the photo and the dynamic link (can test by commenting out the SocialShare part), but when the app tried to open Instagram on iOS I am getting the following error</p>
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
  </code></pre>
  <p>Image is generated using</p>
  <pre><code>final newImage = await _socialShareService.sharedImage();
  
  //then image is saved to Firebase and dynamic link generated
  final postsUpdateData = createPostsRecordData(
       sharedImage: newImage);
  await containerPostsRecord.reference.update(
        postsUpdateData);
  
  var uri = await _dynamicLinkService
        .createDynamicLink()
  print(uri.toString());
  
  //this is where the error is occurring
  await SocialShare.shareInstagramStory(newImage,
         backgroundBottomColor: &quot;#000000&quot;,
         backgroundTopColor: &quot;#ffffff&quot;,
         attributionURL: uri.toString());
  </code></pre>
  <p>I am having trouble understanding the error to figure out what is being called on nil. Full error message is below</p>
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
  *** First throw call stack:
  (0x180e350fc 0x199685d64 0x180f3e564 0x180f496e0 0x180df2514 0x180e10ebc 0x101d6c0a4 0x10507a75c 0x104bb3cf8 0x104f41bb4 0x104e691c0 0x104e6cf24 0x180e4a318 0x180dcecf0 0x180dc94ec 0x180da7d08 0x180dbb468 0x19c95f38c 0x18375e5d0 0x1834dcf74 0x100a1fb68 0x101589aa4)
  libc++abi: terminating with uncaught exception of type NSException
  * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
      frame #0: 0x00000001b84f7964 libsystem_kernel.dylib`__pthread_kill + 8
  libsystem_kernel.dylib`__pthread_kill:
  -&gt;  0x1b84f7964 &lt;+8&gt;:  b.lo   0x1b84f7984               ; &lt;+40&gt;
      0x1b84f7968 &lt;+12&gt;: pacibsp 
      0x1b84f796c &lt;+16&gt;: stp    x29, x30, [sp, #-0x10]!
      0x1b84f7970 &lt;+20&gt;: mov    x29, sp
  Target 0: (Runner) stopped.
  </code></pre>
  <p>I know the error is coming from the AppDelegate.swift function, but I am not sure exactly how to solve this. Any insight is greatly appreciated!</p>
  <p>UPDATED: Info.plist does include facebook and instagram.</p>
  <pre><code>&lt;key&gt;FacebookAppID&lt;/key&gt;
      &lt;string&gt;xxxxxxxxxxxxx&lt;/string&gt;
      &lt;key&gt;FacebookDisplayName&lt;/key&gt;
      &lt;string&gt;name&lt;/string&gt;
      &lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;fbapi&lt;/string&gt;
          &lt;string&gt;fbauth&lt;/string&gt;
          &lt;string&gt;fb-messenger-share-api&lt;/string&gt;
          &lt;string&gt;fbauth2&lt;/string&gt;
          &lt;string&gt;fbshareextension&lt;/string&gt;
          &lt;string&gt;instagram-stories&lt;/string&gt;
          &lt;string&gt;facebook-stories&lt;/string&gt;
          &lt;string&gt;facebook&lt;/string&gt;
          &lt;string&gt;instagram&lt;/string&gt;
          &lt;string&gt;twitter&lt;/string&gt;
          &lt;string&gt;whatsapp&lt;/string&gt;
      &lt;/array&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/XuaWw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XuaWw.png" alt="enter image description here" /></a></p>