【问题标题】:Flutter Bluetooth giving error when app run in permission handling当应用程序在权限处理中运行时,颤振蓝牙给出错误
【发布时间】:2022-01-15 08:59:21
【问题描述】:

发布获取

插件flutter_twitter_login 使用已弃用的 Android 嵌入的版本。避免意外运行时 失败,或者未来的构建失败,尝试看看这些插件 支持 Android V2 嵌入。否则,请考虑删除它们 因为 Flutter 的未来版本将删除这些已弃用的 API。 如果您是插件作者,请查看迁移文档的文档 V2嵌入的插件: https://flutter.dev/go/android-plugin-migration.

运行控制台

C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-6.1.3\android\src\main\java\com\baseflow\permissionhandler\ServiceManager.java:152: warning: [deprecation] getDefaultAdapter() in BluetoothAdapter has been deprecated
        final BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
                                                                  ^
error: warnings found and -Werror specified
1 warning

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':permission_handler:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4m 37s

【问题讨论】:

    标签: android flutter bluetooth flutter-build


    【解决方案1】:

    尝试将此命令放在控制台中以更新到最新版本的插件 flutter pub 升级 --major-versions

    【讨论】:

      猜你喜欢
      • 2018-11-19
      • 2021-11-03
      • 2022-01-09
      • 2014-10-24
      • 1970-01-01
      • 1970-01-01
      • 2020-03-15
      • 2021-11-28
      • 2021-08-26
      相关资源
      最近更新 更多