title: KeyNotFoundException: The given key was not present in the dictionary (C# Unity ANDROID APP)
body: <p>I know my title has so many duplicates but i can't seem to find any the same problem as mine . Let me paste my code.</p>
  
  <h1>LocalizationManager.cs</h1>
  
  <pre><code>rh.eLanguage language = tzGlobal.Instance.OPTION.language;
  
      string json = StreetUtility.LoadJsonFromStreamingAssets("notice.json");
      if (json != null)
      {
          // Separate only the necessary parts.
          LitJson.JsonData data = LitJson.JsonMapper.ToObject(json);
          json = data[language.ToString()].ToJson();
  
          notice = LitJson.JsonMapper.ToObject&lt;string[]&gt;(json);
      }
  
      string path = string.Format("{0}/{1}/language", rh.Const.LOCALIZATION_PATH, language);
      json = StreetUtility.LoadJsonFromResources(path);
      if (json != null)
      {
          // json load.
          Dictionary&lt;string, string&gt; dic = LitJson.JsonMapper.ToObject&lt;Dictionary&lt;string, string&gt;&gt;(json);
  
          // dictionary copy.
          dic_localization_text = new Dictionary&lt;eTextKey, string&gt;();
          eTextKey e;
          for (int i = 0; i &lt; dic.Count; i++)
          {
              e = (eTextKey)i;
              dic_localization_text[e] = dic[e.ToString()];
          }
  
          // Run registered localize function.
          for (int i = 0; i &lt; list_localize_method.Count; i++)
          {
              complete = false;
              list_localize_method[i].Invoke();
              yield return new WaitUntil(() =&gt; complete);
          }
      }
  
      Debug.LogWarning("TODO: Loading popup off.");
  </code></pre>
  
  <p><strong>NOTE:</strong> I have 2 Version (PC Version) and (MOBILE Version) the PC Version is working very fine now my problem is the Mobile Version</p>
  
  <p><strong>NOTE:</strong> <em>this is an android application(apk)</em></p>
  
  <p>What I am doing here on <code>LocalizationManager</code> is that I'm loading the json file from my streaming asset which is the (<code>notice.json</code>) but the problem is that on my logcat it has this error </p>
  
  <blockquote>
    <p>:KeyNotFoundException: The given key was not present in the dictionary.at System.Collections.Generic.Dictionary`2[System.String,LitJson.JsonData].get_Item (System.String key) [0x00000] in :0 
                                              at LitJson.JsonData.get_Item (System.String prop_name) [0x00000] in :0 
                                              at LocalizationManager+c__Iterator0.MoveNext () [0x00000] in :0 
                                              at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0 </p>
  </blockquote>
  
  <p>Maybe you will asked what i am doing . I am doing a <code>Choose Language Scenario</code>.<a href="https://i.stack.imgur.com/ltjdn.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ltjdn.jpg" alt="enter image description here"></a>  </p>
  
  <p>As you can see on the image if i choose Korea it must change to Korea and so on.</p>
  
  <p>And for further information here is my <code>StreetUtility.LoadJsonFromStreamingAsset</code> function</p>
  
  <pre><code>public static string LoadJsonFromStreamingAssets(string path_with_extention_under_streaming_assets_folder)
  {
      string json = null;
      try
      {
          //Android Platform
    #if UNITY_ANDROID
  
          string full_path = Application.persistentDataPath + path_with_extention_under_streaming_assets_folder;
          WWW reader = new WWW(full_path);
          while (!reader.isDone) { }
          json = reader.text;
  
          Debug.Log("Loaded Files: " + json);
  
  
    #elif UNITY_IOS //IOS Platform
  
    #elif UNITY_STANDALONE //PC Platform
          string full_path = string.Format("{0}/{1}", Application.streamingAssetsPath, path_with_extention_under_streaming_assets_folder);
          StreamReader reader = new StreamReader(full_path);
          json = reader.ReadToEnd().Trim();
          reader.Close();
  
          Debug.Log(json);
    #endif
      }
      catch (Exception e)
      {
          Debug.LogWarningFormat("Failed to Load.\n{0}\n{1}", e, path_with_extention_under_streaming_assets_folder);
      }
      return json;
  }
  </code></pre>
  
  <p>This line of code has something to do with the error also. I'm pretty sure of that</p>
  
  <pre><code>#if UNITY_ANDROID
  
          string full_path = Application.persistentDataPath + path_with_extention_under_streaming_assets_folder;
          WWW reader = new WWW(full_path);
          while (!reader.isDone) { }
          json = reader.text;
  
          Debug.Log("Loaded Files: " + json);
  </code></pre>
  
  <p>Thank you very much in advance and I will apologize if you don't understand my english. Please just ask. Thank you again.</p>