Its weird because its working in the implementation, but the editor is highlighting in red the last word of the import (see attached image). And underlining the file as "with errors".
On my app gradle I have:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.code.gson:gson:2.8.6'
on the other gradle:
buildscript {
ext.kotlin_version = "1.5.10"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir}
Also I have errors in the code but its running.
Can anyone point me in the right direction? Thanks!
Try to update gson dependency to 2.8.7 :
implementation 'com.google.code.gson:gson:2.8.7
'
Add jcenter
to repositories in build.grade (Project:%name%)
buildscript {
repositories {
//
jcenter()
}
....
allprojects {
repositories {
//
jcenter()
}
}
Then sync gradle. This should work.