Android Studio: Add jar as library?

后端 未结 30 2483
天命终不由人
天命终不由人 2020-11-21 05:54

I\'m trying to use the new Android Studio but I can\'t seem to get it working correctly.

I\'m using the Gson library to serialize/deserialize JSON-o

30条回答
  •  忘掉有多难
    2020-11-21 06:36

    Like many before pointed out you shall add

    compile files('libs/gson-2.2.3.jar') 
    

    to your build.gradle file.

    However I have a project in Android Studio that was migrated from Eclipse and in this case the "libs" folder is named "lib" so for me removing the "s" solved the problem.

提交回复
热议问题