flutter_packages icon indicating copy to clipboard operation
flutter_packages copied to clipboard

Permission denied, errno = 13

Open schigabiga opened this issue 1 year ago • 1 comments

Hello! I started to use https://pub.dev/packages/linux_serial this package, but after I run on Android 11 mobile and called the below function I got an error. final ports = SerialPorts.ports; print(ports);

Error: Directory listing failed, path = '/sys/dev/char/' (OS Error: Permission denied, errno = 13)

Stack:

#0      _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1      _Directory.listSync (dart:io/directory_impl.dart:243:5)
#2      SerialPorts.ports (package:linux_serial/src/linux_serial.dart:581:7)
#3      _MyHomePageState._incrementCounter (package:usb_serial_test/main.dart:37:31)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:1005:21)
#5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:198:24)
#6      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:613:11)
#7      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:298:5)

I got the same error, when I used these packages: https://pub.dev/packages/libserialport , https://pub.dev/packages/flutter_libserialport

What kind of permission should I grant? Thank you in advance!

Flutter version:

Flutter 3.0.0
Framework • revision ee4e09cce0 (8 months ago) • 2022-05-09 16:45:18 -0700
Engine • revision d1b9a6938a
Tools • Dart 2.17.0 • DevTools 2.12.2

schigabiga avatar Jan 05 '23 14:01 schigabiga