0
package com.example.youtube

import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel   

class MainActivity: FlutterActivity() {
  private val CHANNEL = "jojo"

  override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    super.!configureFlutterEngine(flutterEngine)
    MethodChannel(  
    flutterEngine.dartExecutor.binaryMessenger,CHANNEL).!setMethodCallHandler {
      call, result ->
      if (call.method!=="printy"){
          result.success("hai")
      }
    }
  }  
  }

I have an error on the CHANNEL variable. I get error in this line flutterEngine.dartExecutor.binaryMessenger,CHANNEL).

  • Does this answer your question? [IntelliJ Kotlin - How do I fix "Ensure that you have a dependency on the Kotlin standard library" in a project?](https://stackoverflow.com/questions/64906975/intellij-kotlin-how-do-i-fix-ensure-that-you-have-a-dependency-on-the-kotlin) – enzo Aug 01 '21 at 17:13
  • I am using flutter. I write kotlin for flutter native support. Initially, I have 6 errors like this. Those 6 errors are null safety. I resolve 5 errors but this error is not resolved. – Joshua Jenny Sibbu Aug 01 '21 at 18:22

0 Answers0