【问题标题】:Flutter Android app: OnBackInvokedCallback is not enabled for the application. Set enableOnBackInvokedCallback="true"Flutter Android 应用程序:应用程序未启用 OnBackInvokedCallback。设置 enableOnBackInvokedCallback=\"true\"
【发布时间】:2022-12-11 03:52:04
【问题描述】:

我正在为 android 开发一个 flutter 应用程序(flutter 版本 3.3.9,compileSdkVersion = 33),我在控制台中看到了很多:

    D/InputMethodManager(20966): showSoftInput() view=io.flutter.embedding.android.FlutterView{55ec592 VFE...... .F....ID 0,0-1080,2337 #2 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
    W/OnBackInvokedCallback(20966): OnBackInvokedCallback is not enabled for the application.
    W/OnBackInvokedCallback(20966): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
    D/InsetsController(20966): show(ime(), fromIme=true)
    D/InputMethodManager(20966): showSoftInput() view=io.flutter.embedding.android.FlutterView{55ec592 VFE...... .F...... 0,0-1080,2337 #2 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
    D/InsetsController(20966): show(ime(), fromIme=true)
    D/InputMethodManager(20966): showSoftInput() view=io.flutter.embedding.android.FlutterView{55ec592 VFE...... .F...... 0,0-1080,2337 #2 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
    D/InsetsController(20966): show(ime(), fromIme=true)

我真的应该将 enableOnBackInvokedCallback 设置为 true 吗?在this SO 问题中,answer 解释了为什么会发生这种情况。

但是由于我不是在原生android中开发而是在flutter中开发,所以对我来说是不是一样? 我应该关心这个吗?

(通常我让 flutter 管理所有原生的东西,大多数时候最好不要改变任何东西)

【问题讨论】:

    标签: android flutter


    【解决方案1】:

    得到同样的错误

    你找到答案了吗?

    【讨论】:

      猜你喜欢
      • 2022-12-18
      • 2013-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多