Is There An Easier Way To Add Gson To My Project?
How do I add gson to my project with gradle? I only see people adding files to their projects. I don't want to download the project and put it in mine.
Solution 1:
In app/build.gradle:
dependencies {
compile'com.google.code.gson:gson:2.8.2'
}
Solution 2:
If you are using Android Studio you can use the following workflow instead of manually changing Gradle files:
- File -> Project Structure -> Modules -> app -> Dependencies Tab
- Click '+' in the bottom left corner and select "Library dependency"
- In the search field type: "gson" and click Search
- Select "com.google.code.gson:gson:2.8.5"
Solution 3:
Add following to project’s build.gradle
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.code.gson:gson:2.8.0'
}
Here is the link for more info.
Solution 4:
compile
is obsolete use implementation
instead
dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
}
P.S. version of 08/07/2019
Post a Comment for "Is There An Easier Way To Add Gson To My Project?"