So i added gson-2.2.4.jar to the libs dir (I\'m using android studio). My project couldn\'t find the gson stuff so I added it as a library dependency to my module in the \"P
Add this on build.gradle (Module: app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.code.gson:gson:2.8.0'
}
I have resolved the issue, by making targetSdkVersion same for all library module with the app-level module.
Just to update the reference (I was searching for):
implementation 'com.google.code.gson:gson:2.8.5'
You can see the last version on its github repository
Adding it as a dependency in the Project Structure settings is not enough. That setting is only for the IDE. To actually build, Gradle also needs to be aware of it. You must add the .jar file to your build.gradle file like so...
dependencies {
compile files('libs/gson-2.2.4.jar')
}
Try this GSON . Add this on build.gradle (Module :app)
implementation 'com.google.code.gson:gson:2.2.4'
Just to add a point,
As of Gradle 1.7, jcenter() is a superset of mavenCentral()...so no need of adding and repositories directive.
Jars will be downloaded from online central jcenter repository. so adding just the following statement is working.
dependencies {
compile 'com.google.code.gson:gson:2.2.+'
}