https://kotlinlang.org logo
Title
t

Travis Griggs

02/15/2020, 1:47 AM
I am trying to include HiveMQ’s android client library for MQTT. However, when I follow their code samples:
this.client = Mqtt3Client.builder()
      .identifier(clientId)
      .serverHost("<http://abc.xyz.com|abc.xyz.com>")
      .sslWithDefaultConfig()
      .buildAsync()
The
builder()
message is being underlined in red and the popup error message says:
Calls to static methods in Java interfaces are prohibited in JVM target 1.6 Recompile with '-jvm-target 1.8'
Is there a way to fix this. Or rather, how do I do what it’s telling me to do? Somewhat of a neophyte with kotlin/Android here, be kind please.
i

itnoles

02/15/2020, 2:04 AM
Set JvmTarget to 1.8 under kotlinOptions in Gradle
g

gilsonjuniorpro

02/15/2020, 11:02 PM
android { // Past this code in your app gradle inside android {. } compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } kotlinOptions { jvmTarget = "1.8" } }