[转载]Android 中导入Gson jar包后出现 java.lang.NoClassDefFoundError: com.google.gson.GsonBuilder的解决办法 – – 博客频道 – CSDN.NET.
- Create a new folder named “libs” in your Eclipse/Android workspace project (you can do it in Windows Explorer if you’re using Windows OS).
- In Eclipse, right-click on the project and choose “refresh”, this will refresh your project and add the “libs” folder
- Right-click on the “libs” folder, choose Import > General > File System. Click NEXT and then browse in your pc to find the parent folder of the library you want to add (N.B. select the parent folder of the library, not the library.jar) and then click OK
- Click the directory name of the library (which is displayed in the left panel) -not the checkbox-
- On the right panel will be displayed the list of JAR files in that folder, select the checkbox of the one you want to install and click FINISH (this operation will add the library to your project, now you have to make it available for the project code)
- Right-click on your project, choose Build Path > Configure Build Path…
- In the libraries tab click in Add JARs…, browse your project andfinr the library in your libs folder, add it.