I'm trying to debug android native code (kotlin) for flutter using the print().
The problem I'm facing is that it doesn't print in the console when I run the app.
class MainActivity : FlutterActivity() {
private val channel = "com.example.pomo_app/mychannel"
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channel)
.setMethodCallHandler { call, result ->
when (call.method) {
"getAllRingtones" -> {
// this doesn't print to console
print("Native code works")
}
CodePudding user response:
You have to use Log.d("TAG", "your log message")
for Android native logs.
Kotlin print()
and println()
methods won't work.
Bit if you want to log some native ios code, you can use print()
and println()
methods in Swift