I am trying to include HiveMQ’s android client lib...
# android
t
I am trying to include HiveMQ’s android client library for MQTT. However, when I follow their code samples:
Copy code
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:
Copy code
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
Set JvmTarget to 1.8 under kotlinOptions in Gradle
g
android { // Past this code in your app gradle inside android {. } compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } kotlinOptions { jvmTarget = "1.8" } }