Directory listing failed, path = '/sdcard/Android/data' (OS Error: Permission denied, errno = 13)
minSdkVersion 21
compileSdkVersion flutter.compileSdkVersion
targetSdkVersion flutter.targetSdkVersion
In main.dart
try to list all the directories and the files in the sdcard folder of your android device
import 'dart:io';
import 'package:flutter/material.dart';
void main() async {
runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State<HomePage> createState() => _HomePageState();
class _HomePageState extends State<HomePage> {
late Directory dir;
late List contents;
late List<File> files;
@override
void initState() {
super.initState();
dir = Directory('/sdcard/');
contents = dir.listSync(recursive: true, followLinks: false);
print(contents.first.toString().split('/'));
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ListView.builder(
itemCount: contents.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(contents.elementAt(index).toString().split('/')[0]),
Expected results:
I'd be able to access all the files and directories
Actual results:
The /sdcard/android/
folder is denying me access altogether.
Here's some additional information if you need.
flutter create bug
cd bug
flutter run
Here's what came up on my console
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following FileSystemException was thrown building Builder:
Directory listing failed, path = '/sdcard/Android/data' (OS Error: Permission denied, errno = 13)
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///C:/dev/flutter/practice/bug/lib/main.dart:13:12
When the exception was thrown, this was the stack:
#0 _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1 _Directory.listSync (dart:io/directory_impl.dart:243:5)
#2 _HomePageState.initState (package:bug/main.dart:34:20)
#3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4942:57)
#4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4781:5)
... Normal element mounting (275 frames)
#279 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#280 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6350:36)
#281 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6362:32)
... Normal element mounting (377 frames)
#658 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#659 Element.updateChild (package:flutter/src/widgets/framework.dart:3551:18)
#660 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1202:16)
#661 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1171:5)
#662 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1119:18)
#663 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2597:19)
#664 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1118:13)
#665 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:953:7)
#666 WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:933:7)
(elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
════════════════════════════════════════════════════════════════════════════════════════════════════
E/LB (19849): fail to open file: No such file or directory
I/com.example.bu(19849): ProcessProfilingInfo new_methods=968 is saved saved_to_disk=1 resolve_classes_delay=8000
ran flutter run --verbose
command. Here are the results
PS C:\dev\flutter\practice\bug\linux> cd ..
PS C:\dev\flutter\practice\bug> cd ..
PS C:\dev\flutter\practice> flutter run --verbose
[ +88 ms] executing: [C:\src\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +368 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +2 ms] f1875d570e39de09040c8f79aa13cc56baab8db1
[ ] executing: [C:\src\flutter/] git tag --points-at f1875d570e39de09040c8f79aa13cc56baab8db1
[ +63 ms] Exit code 0 from: git tag --points-at f1875d570e39de09040c8f79aa13cc56baab8db1
[ ] 3.0.5
[ +9 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +53 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [C:\src\flutter/] git ls-remote --get-url origin
[ +49 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +139 ms] executing: [C:\src\flutter/] git rev-parse --abbrev-ref HEAD
[ +58 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] stable
[ +96 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +66 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +112 ms] List of devices attached
430e8a730521 device product:citrus_in model:M2010J19CI device:citrus transport_id:1
[ +8 ms] C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell getprop
[ +183 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +5 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +152 ms] Skipping pub get: version match.
[ +41 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.11\
[ +5 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.16\
[ +2 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.10\
[ +2 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.7\
[ +2 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.6\
[ +3 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.7\
[ +66 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.11\
[ +2 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.16\
[ +2 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.10\
[ +2 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.7\
[ +1 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.6\
[ +3 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.7\
[ +22 ms] Generating C:\dev\flutter\practice\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +63 ms] ro.hardware = qcom
[ +44 ms] Initializing file store
[ +14 ms] Skipping target: gen_localizations
[ +5 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\dev\flutter\practice\.dart_tool\package_config_subset,C:\dev\flutter\practice\.dart_tool\flutter_build\dart_plugin_registrant.dart}
[ +21 ms] Found plugin path_provider at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.11\
[ +1 ms] Found plugin path_provider_android at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.16\
[ +1 ms] Found plugin path_provider_ios at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.10\
[ +1 ms] Found plugin path_provider_linux at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.7\
[ +1 ms] Found plugin path_provider_macos at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.6\
[ +1 ms] Found plugin path_provider_windows at C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.7\
[ +15 ms] gen_dart_plugin_registrant: Complete
[ +2 ms] Skipping target: _composite
[ +2 ms] complete
[ +6 ms] Launching lib\main.dart on M2010J19CI in debug mode...
[ +7 ms] C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\src\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root
C:\src\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
C:\Users\kings\AppData\Local\Temp\flutter_tools.4f52302c\flutter_tool.efb2ea43\app.dill --packages C:\dev\flutter\practice\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts
--track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --source C:\dev\flutter\practice\.dart_tool\flutter_build\dart_plugin_registrant.dart
--source package:flutter/src/dart_plugin_registrant.dart -Dflutter.dart_plugin_registrant=file:///C:/dev/flutter/practice/.dart_tool/flutter_build/dart_plugin_registrant.dart --enable-experiment=alternative-invalidation-strategy
[ +10 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\build-tools\33.0.0\aapt dump xmltree C:\dev\flutter\practice\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +30 ms] Exit code 0 from: C:\Users\kings\AppData\Local\Android\sdk\build-tools\33.0.0\aapt dump xmltree C:\dev\flutter\practice\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +2 ms] N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x1
A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
A: package="com.example.practice" (Raw: "com.example.practice")
A: platformBuildVersionCode=(type 0x10)0x1f
A: platformBuildVersionName=(type 0x10)0xc
E: uses-sdk (line=7)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
E: uses-permission (line=15)
A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
E: uses-permission (line=16)
A: android:name(0x01010003)="android.permission.WRITE_EXTERNAL_STORAGE" (Raw: "android.permission.WRITE_EXTERNAL_STORAGE")
E: uses-permission (line=17)
A: android:name(0x01010003)="android.permission.READ_EXTERNAL_STORAGE" (Raw: "android.permission.READ_EXTERNAL_STORAGE")
E: uses-permission (line=18)
A: android:name(0x01010003)="android.permission.MANAGE_EXTERNAL_STORAGE" (Raw: "android.permission.MANAGE_EXTERNAL_STORAGE")
E: application (line=20)
A: android:label(0x01010001)="notPractice" (Raw: "notPractice")
A: android:icon(0x01010002)=@0x7f080000
A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
E: activity (line=26)
A: android:theme(0x01010000)=@0x7f0a0000
A: android:name(0x01010003)="com.example.practice.MainActivity" (Raw: "com.example.practice.MainActivity")
A: android:exported(0x01010010)=(type 0x12)0xffffffff
A: android:launchMode(0x0101001d)=(type 0x10)0x1
A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
E: meta-data (line=41)
A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
A: android:resource(0x01010025)=@0x7f0a0001
E: intent-filter (line=45)
E: action (line=46)
A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
E: category (line=48)
A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
E: meta-data (line=55)
A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
A: android:value(0x01010024)=(type 0x10)0x2
E: uses-library (line=59)
A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
A: android:required(0x0101028e)=(type 0x12)0x0
E: uses-library (line=62)
A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
A: android:required(0x0101028e)=(type 0x12)0x0
[ +8 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell -x logcat -v time -t 1
[ +19 ms] <- compile package:practice/main.dart
[ +225 ms] --------- beginning of main
07-24 02:55:33.679 D/displayfeature( 825): 2.[lyd_hbm]updataHBMLightValue: dataLux = 71
[ +9 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe version
[ +86 ms] Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
Installed as C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe
[ +2 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[ +84 ms] Building APK
[ +14 ms] Running Gradle task 'assembleDebug'...
[ +4 ms] Using gradle from C:\dev\flutter\practice\android\gradlew.bat.
[ +15 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +168 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ ] openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
OpenJDK 64-Bit Server VM (build 11.0.12+7-b1504.28-7817840, mixed mode)
[ +1 ms] executing: [C:\dev\flutter\practice\android/] C:\dev\flutter\practice\android\gradlew.bat -Pverbose=true -Ptarget-platform=android-arm64 -Ptarget=C:\dev\flutter\practice\lib\main.dart
-Pbase-application-name=android.app.Application -Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root
assembleDebug
[+1539 ms] > Task :app:preBuild UP-TO-DATE
[ +1 ms] > Task :app:preDebugBuild UP-TO-DATE
[ ] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[+15988 ms] > Task :app:compileFlutterBuildDebug
[ +1 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ ] > Task :path_provider_android:preBuild UP-TO-DATE
[ ] > Task :path_provider_android:preDebugBuild UP-TO-DATE
[ ] > Task :path_provider_android:compileDebugAidl NO-SOURCE
[ ] > Task :app:compileDebugAidl NO-SOURCE
[ ] > Task :path_provider_android:packageDebugRenderscript NO-SOURCE
[ ] > Task :app:compileDebugRenderscript NO-SOURCE
[ ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ ] > Task :path_provider_android:writeDebugAarMetadata UP-TO-DATE
[ ] > Task :app:checkDebugAarMetadata UP-TO-DATE
[ ] > Task :app:cleanMergeDebugAssets
[ +90 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[ ] > Task :app:compileDebugShaders NO-SOURCE
[ ] > Task :app:generateDebugAssets UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugShaders UP-TO-DATE
[ ] > Task :path_provider_android:compileDebugShaders NO-SOURCE
[ ] > Task :path_provider_android:generateDebugAssets UP-TO-DATE
[ ] > Task :path_provider_android:packageDebugAssets UP-TO-DATE
[ ] > Task :app:mergeDebugAssets
[ +392 ms] > Task :app:copyFlutterAssetsDebug
[ +1 ms] > Task :app:generateDebugResValues UP-TO-DATE
[ ] > Task :app:generateDebugResources UP-TO-DATE
[ ] > Task :path_provider_android:compileDebugRenderscript NO-SOURCE
[ ] > Task :path_provider_android:generateDebugResValues UP-TO-DATE
[ ] > Task :path_provider_android:generateDebugResources UP-TO-DATE
[ ] > Task :path_provider_android:packageDebugResources UP-TO-DATE
[ ] > Task :app:mergeDebugResources UP-TO-DATE
[ ] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ ] > Task :app:extractDeepLinksDebug UP-TO-DATE
[ ] > Task :path_provider_android:extractDeepLinksDebug UP-TO-DATE
[ ] > Task :path_provider_android:processDebugManifest UP-TO-DATE
[ ] > Task :app:processDebugMainManifest UP-TO-DATE
[ ] > Task :app:processDebugManifest UP-TO-DATE
[ ] > Task :app:processDebugManifestForPackage UP-TO-DATE
[ ] > Task :path_provider_android:compileDebugLibraryResources UP-TO-DATE
[ ] > Task :path_provider_android:parseDebugLocalResources UP-TO-DATE
[ ] > Task :path_provider_android:generateDebugRFile UP-TO-DATE
[ ] > Task :app:processDebugResources UP-TO-DATE
[ ] > Task :path_provider_android:generateDebugBuildConfig UP-TO-DATE
[ ] > Task :path_provider_android:javaPreCompileDebug UP-TO-DATE
[ ] > Task :path_provider_android:compileDebugJavaWithJavac UP-TO-DATE
[ +1 ms] > Task :path_provider_android:bundleLibCompileToJarDebug UP-TO-DATE
[ +95 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[ +1 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[ ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[ ] > Task :app:processDebugJavaRes NO-SOURCE
[ ] > Task :path_provider_android:processDebugJavaRes NO-SOURCE
[ ] > Task :path_provider_android:bundleLibResDebug NO-SOURCE
[ ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[ ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ ] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[ ] > Task :app:mergeExtDexDebug UP-TO-DATE
[ ] > Task :path_provider_android:bundleLibRuntimeToJarDebug UP-TO-DATE
[ ] > Task :app:dexBuilderDebug UP-TO-DATE
[ +89 ms] > Task :app:mergeLibDexDebug UP-TO-DATE
[ +1 ms] > Task :app:mergeProjectDexDebug UP-TO-DATE
[ ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugJniLibFolders UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugNativeLibs NO-SOURCE
[ ] > Task :path_provider_android:copyDebugJniLibsProjectOnly UP-TO-DATE
[ ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[ ] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[ ] > Task :app:validateSigningDebug UP-TO-DATE
[ ] > Task :app:writeDebugAppMetadata UP-TO-DATE
[ ] > Task :app:writeDebugSigningConfigVersions UP-TO-DATE
[ ] > Task :path_provider_android:stripDebugDebugSymbols NO-SOURCE
[ ] > Task :path_provider_android:copyDebugJniLibsProjectAndLocalJars UP-TO-DATE
[ ] > Task :path_provider_android:extractDebugAnnotations UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugGeneratedProguardFiles UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugConsumerProguardFiles UP-TO-DATE
[ ] > Task :path_provider_android:prepareDebugArtProfile UP-TO-DATE
[ ] > Task :path_provider_android:prepareLintJarForPublish UP-TO-DATE
[ ] > Task :path_provider_android:mergeDebugJavaResource UP-TO-DATE
[ ] > Task :path_provider_android:syncDebugLibJars UP-TO-DATE
[ ] > Task :path_provider_android:bundleDebugAar UP-TO-DATE
[ ] > Task :path_provider_android:assembleDebug UP-TO-DATE
[ +690 ms] > Task :app:compressDebugAssets
[ ] Execution optimizations have been disabled for task ':app:compressDebugAssets' to ensure correctness due to the following reasons:
[ ] - Gradle detected a problem with the following location: 'C:\dev\flutter\practice\build\app\intermediates\assets\debug\mergeDebugAssets'. Reason: Task ':app:compressDebugAssets' uses this output of task
':app:copyFlutterAssetsDebug' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to
https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
[ +1 ms] > Task :app:packageDebug UP-TO-DATE
[ ] > Task :app:createDebugApkListingFileRedirect UP-TO-DATE
[ +241 ms] > Task :app:assembleDebug
[ +1 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[ ] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[ ] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[ ] Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
[ ] Please consult deprecation warnings for more details.
[ ] BUILD SUCCESSFUL in 19s
[ ] 62 actionable tasks: 6 executed, 56 up-to-date
[ +531 ms] Running Gradle task 'assembleDebug'... (completed in 19.9s)
[ +54 ms] calculateSha: LocalDirectory: 'C:\dev\flutter\practice\build\app\outputs\flutter-apk'/app.apk
[ +695 ms] √ Built build\app\outputs\flutter-apk\app-debug.apk.
[ +3 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\build-tools\33.0.0\aapt dump xmltree C:\dev\flutter\practice\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +33 ms] Exit code 0 from: C:\Users\kings\AppData\Local\Android\sdk\build-tools\33.0.0\aapt dump xmltree C:\dev\flutter\practice\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ ] N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x1
A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
A: android:compileSdkVersionCodename(0x01010573)="12" (Raw: "12")
A: package="com.example.practice" (Raw: "com.example.practice")
A: platformBuildVersionCode=(type 0x10)0x1f
A: platformBuildVersionName=(type 0x10)0xc
E: uses-sdk (line=7)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x15
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
E: uses-permission (line=15)
A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
E: uses-permission (line=16)
A: android:name(0x01010003)="android.permission.WRITE_EXTERNAL_STORAGE" (Raw: "android.permission.WRITE_EXTERNAL_STORAGE")
E: uses-permission (line=17)
A: android:name(0x01010003)="android.permission.READ_EXTERNAL_STORAGE" (Raw: "android.permission.READ_EXTERNAL_STORAGE")
E: uses-permission (line=18)
A: android:name(0x01010003)="android.permission.MANAGE_EXTERNAL_STORAGE" (Raw: "android.permission.MANAGE_EXTERNAL_STORAGE")
E: application (line=20)
A: android:label(0x01010001)="notPractice" (Raw: "notPractice")
A: android:icon(0x01010002)=@0x7f080000
A: android:name(0x01010003)="android.app.Application" (Raw: "android.app.Application")
A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw: "androidx.core.app.CoreComponentFactory")
E: activity (line=26)
A: android:theme(0x01010000)=@0x7f0a0000
A: android:name(0x01010003)="com.example.practice.MainActivity" (Raw: "com.example.practice.MainActivity")
A: android:exported(0x01010010)=(type 0x12)0xffffffff
A: android:launchMode(0x0101001d)=(type 0x10)0x1
A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
E: meta-data (line=41)
A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw: "io.flutter.embedding.android.NormalTheme")
A: android:resource(0x01010025)=@0x7f0a0001
E: intent-filter (line=45)
E: action (line=46)
A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
E: category (line=48)
A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw: "android.intent.category.LAUNCHER")
E: meta-data (line=55)
A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
A: android:value(0x01010024)=(type 0x10)0x2
E: uses-library (line=59)
A: android:name(0x01010003)="androidx.window.extensions" (Raw: "androidx.window.extensions")
A: android:required(0x0101028e)=(type 0x12)0x0
E: uses-library (line=62)
A: android:name(0x01010003)="androidx.window.sidecar" (Raw: "androidx.window.sidecar")
A: android:required(0x0101028e)=(type 0x12)0x0
[ +2 ms] Stopping app 'app.apk' on M2010J19CI.
[ ] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell am force-stop com.example.practice
[ +213 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell pm list packages com.example.practice
[ +192 ms] package:com.example.practice
[ +2 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell cat /data/local/tmp/sky.com.example.practice.sha1
[ +153 ms] 5a9640fcb539f8e7f9443d925c7765ef0727f93a
[ +1 ms] Latest build already installed.
[ ] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell -x logcat -v time -t 1
[ +218 ms] --------- beginning of main
07-24 02:55:55.371 I/cnss-daemon( 1367): nl80211_response_handler: cmd 103, vendorID 4980, subcmd 13 received
[ +7 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-dart-profiling true --ez enable-checked-mode true --ez
verify-entry-points true com.example.practice/com.example.practice.MainActivity
[ +179 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.practice/.MainActivity (has extras) }
[ ] Waiting for observatory port to be available...
[ +680 ms] Observatory URL on device: http://127.0.0.1:37121/6rI4o_DP4dI=/
[ +1 ms] executing: C:\Users\kings\AppData\Local\Android\sdk\platform-tools\adb.exe -s 430e8a730521 forward tcp:0 tcp:37121
[ +77 ms] 56940
[ ] Forwarded host port 56940 to device port 37121 for Observatory
[ +7 ms] Caching compiled dill
[ +38 ms] Connecting to service protocol: http://127.0.0.1:56940/6rI4o_DP4dI=/
[ +332 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at http://127.0.0.1:56940/6rI4o_DP4dI=/.
[ +197 ms] DDS is listening at http://127.0.0.1:56943/HtfoZmecC7M=/.
[ +60 ms] Successfully connected to service protocol: http://127.0.0.1:56940/6rI4o_DP4dI=/
[ +89 ms] DevFS: Creating new filesystem on the device (null)
[ +41 ms] DevFS: Created new filesystem on the device (file:///data/user/0/com.example.practice/code_cache/practiceTXTBPF/practice/)
[ +2 ms] Updating assets
[ +84 ms] Syncing files to device M2010J19CI...
[ +2 ms] <- reset
[ ] Compiling dart to kernel with 0 updated files
[ ] Processing bundle.
[ ] <- recompile package:practice/main.dart 1ea9cda7-2826-4c62-a00c-f8b22cea28a0
[ ] <- 1ea9cda7-2826-4c62-a00c-f8b22cea28a0
[ +1 ms] Bundle processing done.
[ +161 ms] Updating files.
[ +1 ms] DevFS: Sync finished
[ +1 ms] Syncing files to device M2010J19CI... (completed in 169ms)
[ +1 ms] Synced 0.0MB.
[ +2 ms] <- accept
[ +5 ms] Connected to _flutterView/0xb4000074d30bde20.
[ +2 ms] Flutter run key commands.
[ +1 ms] r Hot reload.
[ ] R Hot restart.
[ ] h List all available interactive commands.
[ ] d Detach (terminate "flutter run" but leave application running).
[ ] c Clear the screen
[ ] q Quit (terminate the application on the device).
[ +1 ms] Running with sound null safety
[ +1 ms] An Observatory debugger and profiler on M2010J19CI is available at: http://127.0.0.1:56943/HtfoZmecC7M=/
[ +863 ms]
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following FileSystemException was thrown building Builder:
Directory listing failed, path = '/sdcard/Android/data' (OS Error: Permission denied, errno = 13)
The relevant error-causing widget was:
MaterialApp MaterialApp:file:///C:/dev/flutter/practice/lib/main.dart:13:12
When the exception was thrown, this was the stack:
#0 _Directory._fillWithDirectoryListing (dart:io-patch/directory_patch.dart:42:24)
#1 _Directory.listSync (dart:io/directory_impl.dart:243:5)
#2 _HomePageState.initState (package:practice/main.dart:34:20)
#3 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4942:57)
#4 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4781:5)
... Normal element mounting (275 frames)
#279 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#280 MultiChildRenderObjectElement.inflateWidget (package:flutter/src/widgets/framework.dart:6350:36)
#281 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6362:32)
... Normal element mounting (377 frames)
#658 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3817:16)
#659 Element.updateChild (package:flutter/src/widgets/framework.dart:3551:18)
#660 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1202:16)
#661 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:1171:5)
#662 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (package:flutter/src/widgets/binding.dart:1119:18)
#663 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2597:19)
#664 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:1118:13)
#665 WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:953:7)
#666 WidgetsBinding.scheduleAttachRootWidget.<anonymous closure> (package:flutter/src/widgets/binding.dart:933:7)
(elided 11 frames from class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
════════════════════════════════════════════════════════════════════════════════════════════════════
[ +332 ms] The Flutter DevTools debugger and profiler on M2010J19CI is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:56943/HtfoZmecC7M=/
[ +33 ms] E/LB (20305): fail to open file: No such file or directory
[+90197 ms] W/Looper (20305): PerfMonitor longMsg : seq=177 plan=02:57:27.927 late=0ms wall=1016ms running=0ms h=android.app.ActivityThread$H w=127 procState=2
[+8917 ms] V/MiuiFrameworkFactory(20305): get AllImpl object = android.common.MiuiFrameworkFactoryImpl@55de8c0
[ +13 ms] W/MirrorManager(20305): this model don't Support
Ran `flutter analyze`. There are issues, I know, but they are mostly as I didn't use const.
Analyzing practice...
info - Prefer const with constant constructors - bug\lib\main.dart:5:10 - prefer_const_constructors
info - Prefer const with constant constructors - bug\lib\main.dart:13:12 - prefer_const_constructors
info - Prefer const with constant constructors - bug\lib\main.dart:14:13 - prefer_const_constructors
info - Avoid `print` calls in production code - bug\lib\main.dart:35:5 - avoid_print
info - Prefer const with constant constructors - lib\main.dart:5:10 - prefer_const_constructors
info - Prefer const with constant constructors - lib\main.dart:13:12 - prefer_const_constructors
info - Prefer const with constant constructors - lib\main.dart:14:13 - prefer_const_constructors
info - Avoid `print` calls in production code - lib\main.dart:35:5 - avoid_print
8 issues found. (ran in 3.4s)
Here's the output of flutter doctor -v
.
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1826], locale en-US)
• Flutter version 3.0.5 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (10 days ago), 2022-07-13 11:24:16 -0700
• Engine revision e85ea0e79c
• Dart version 2.17.6
• DevTools version 2.12.2
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at C:\Users\kings\AppData\Local\Android\sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32630.192
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.2)
• Android Studio at C:\Program Files\Android\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.12+7-b1504.28-7817840)
[√] VS Code (version 1.68.1)
• VS Code at C:\Users\kings\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (3 available)
• M2010J19CI (mobile) • 430e8a730521 • android-arm64 • Android 11 (API 30)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.1826]
• Edge (web) • edge • web-javascript • Microsoft Edge 103.0.1264.62
[√] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.
Hi @Inst1nct007, there's currently an open issue requesting for this feature to be added in #40504
Kindly follow up in the linked issue for updates.
Please upvote the original issue as well.
Closing from here as duplicate.
Thank you