Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when access to files #10

Open
gustavomrfz opened this issue Sep 2, 2021 · 1 comment
Open

Error when access to files #10

gustavomrfz opened this issue Sep 2, 2021 · 1 comment

Comments

@gustavomrfz
Copy link

Description

Using example sample pasted at main.dart.
With a Blackview phone with external storage:

The following assertion was thrown while dispatching notifications for ValueNotifier<String>:
setState() or markNeedsBuild() called during build.

This ValueListenableBuilder<String> widget cannot be marked as needing to build because the framework is already in the process of building widgets.  A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.

The widget on which setState() or markNeedsBuild() was called was: ValueListenableBuilder<String>
    state: _ValueListenableBuilderState<String>#6367a
The widget which was currently being built when the offending call was made was: FutureBuilder<List<Directory>?>
    dirty
    state: _FutureBuilderState<List<Directory>?>#4c501

The line that fails at file_manager.dart is:

final List<FileSystemEntity> list = await Directory(path).list().toList();

Storage permissions are given.

Logs

$ flutter analyze
Analyzing filemanager...                                                
No issues found! (ran in 3.7s)
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on Linux, locale es_ES.UTF-8)
    • Flutter version 2.2.3 at /home/user/SDK/flutter
    • Framework revision f4abaa0735 (hace 9 semanas), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/user/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /opt/android-studio-2020.3.1/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2020.3)
    • Android Studio at /opt/android-studio-2020.3.1/android-studio
    • Flutter plugin version 59.0.2
    • Dart plugin version 203.8292
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Android Studio
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.59.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.26.0

[✓] Connected device (1 available)
    • BV4900Pro (mobile) • BV4900EEA000xxxxxx • android-arm64 • Android 10 (API 29)

! Doctor found issues in 2 categories.

Works fine on emulator with Android 10

@gustavomrfz gustavomrfz changed the title Error on permissions Error when access to files Sep 2, 2021
@FaizanKamal7
Copy link

FaizanKamal7 commented Feb 18, 2022

Did you find a way to fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants