Plagueis
Plagueis

Reputation: 183

Android Studio Gradle adding Gson: Unresolved Reference / Please select Android SDK

I add Gson to my gradle dependencies and nearly all dependencies stop to resolve. (additionally I get the "Error: Please select Android SDK"-Error) I know this a well known bug and I can solve it as described in this post.

I took like 3 tries with different versions, but i just not works.

Android Studio: "Please select Android SDK"

Any hints why Gson makes here trouble?

(I'm using Kotlin.)

My Android Studio:

> Android Studio 3.1.2 Build #AI-173.4720617, built on April 13, 2018
> JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by
> JetBrains s.r.o Windows 10 10.0

Relevant gradle.build snippet

implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.4'
// -erro- implementation 'com.google.code.gson:gson:2.8.2'
implementation "com.google.code.gson:gson:+"

Upvotes: 2

Views: 2571

Answers (1)

Nelson Almendra
Nelson Almendra

Reputation: 881

It's not recommended to use the latest version (+), use this instead:

implementation 'com.google.code.gson:gson:2.8.5'

Upvotes: 3

Related Questions