-1

Launching lib\main.dart on SM M013F in debug mode... lib\main.dart:1 C:\fl\flutter.pub-cache\hosted\pub.dartlang.org\permission_handler-7.2.0\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 error 1 warning

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.

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 16s Exception: Gradle task assembleDebug failed with exit code 1

  • Does this answer your question? [getDefaultAdapter() in BluetoothAdapter has been deprecated](https://stackoverflow.com/questions/69894223/getdefaultadapter-in-bluetoothadapter-has-been-deprecated) – plplmax Aug 11 '22 at 11:23

1 Answers1

0

Please make sure you have a backup of the project. The permission handler version seems to be too old. Please use version 10.0.0 (latest) if you are using flutter version > 3 or 8.3.0 if less than flutter version 3.. please update the version in pubspec.yaml and try again

Kaushik Chandru
  • 15,510
  • 2
  • 12
  • 30