我正在试着使用新的Android Studio,但我似乎无法让它正常工作.
我使用Gson库来序列化/反序列化JSON对象.但不知怎么的,这个库并没有包含在构建中.
I had created a new project with just a MainActivity. Copied gson-2.2.3.jar in the /libs folder and added it as a library dependancy(right click->Add as library). This includes the jar in android studio so it can be referenced from the source files.
当我试图运行该项目时,它无法编译,因此我添加了:
compile files('libs/gson-2.2.3.jar')
添加到de.gradle文件中的依赖项.之后,它可以正确编译,但在运行应用程序时,我会得到ClassDefNotFoundException
.
有人知道我做错了什么吗?