天天看點

android gson解析Json,Could not find class 'com.google.gson.Gson'

    用gson方式解析Json字元串時,導入gson.jar後,仍然報Could not find class 'com.google.gson.Gson'的異常資訊。

嘗試這樣來解決:右鍵android項目,選擇build path-->configuere build path-->order and export , 然後勾選gson.jar檔案,然後點OK。

之後還學要将項目clean,在目錄欄中選擇project-->clean,選擇你的android項目進行clean。

重新運作項目即可。