Rhyston Da Silva in MATLAB Answers
上次活动时间: 2021-9-2

I am attempting to take a user input value on an android application and then upload that value to ThingSpeak for further use. I am trying to use Android Studio and Kotlin, but I keep getting the same error. Any guidance will be much appreciated as I would just like to get the application to run. I have created a Button to execute and Two Texts - Number (Signed) for input. Below is the code that I have attempted: import android.os.Bundle import android.view.View import android.widget.Button import androidx.appcompat.app.AppCompatActivity import com.squareup.okhttp.Request import com.squareup.okhttp.OkHttpClient class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val waterAmount = findViewById<View>(R.id.WaterAmount) val temperatureAmount = findViewById<View>(R.id.TemperatureAmount) val dispenseButton = findViewById<Button>(R.id.DispenseButton) dispenseButton.setOnClickListener { val okHttpClient = OkHttpClient() val builder: Request.Builder = Request.Builder() val request: Request = builder.url("https://api.thingspeak.com/update?api_key=APIKEY&field1=" + waterAmount).build() } } } The error that I keep receiving is: Duplicate class org.objectweb.asm.AnnotationVisitor found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.AnnotationWriter found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Attribute found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.ByteVector found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.ClassReader found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.ClassVisitor found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.ClassWriter found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Edge found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.FieldVisitor found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.FieldWriter found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Frame found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Handler found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Item found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Label found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.MethodVisitor found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.MethodWriter found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Opcodes found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.Type found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.signature.SignatureReader found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.signature.SignatureVisitor found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Duplicate class org.objectweb.asm.signature.SignatureWriter found in modules jetified-asm-3.1 (asm:asm:3.1) and jetified-asm-4.0 (org.ow2.asm:asm:4.0) Go to the documentation to learn how to Fix dependency resolution errors.

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.