title: Can't Read file from the asset?
body: <p>In my app, there is a button that will copy the file(in my case txt) to the local download folder. I even ask permission from the phone and it works. But when I read from the txt file, the error said</p>
  <blockquote>
  <p>FileSystemException: Cannot open file, path = 'assets/readme.txt' (OS
  Error: No such file or directory, errno = 2)</p>
  </blockquote>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:permission_handler/permission_handler.dart';
  import 'dart:io';
  import &quot;package:path_provider/path_provider.dart&quot;;
   
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
  int a;
    @override
    Widget build(BuildContext context) {
      
      return MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: Text(&quot;What up&quot;),
          ),
          body: Center(
            child: RaisedButton(
              onPressed: () async {
                await Permission.storage.request();
                if (PermissionStatus == PermissionStatus.granted) {
                  print(&quot;permission granted&quot;);
                }
                if (PermissionStatus == PermissionStatus.denied) {
                  print('permission denied');
                }
               var path = &quot;assets/readme.txt&quot;;
               a = await readCounter();
               print(a);
              },
              child: Text(&quot;Press me&quot;),
               
            ),
          ),
        ),
      );
    }
  }
  
  
  Future&lt;int&gt; readCounter() async {
    try {
      final file = File(&quot;assets/readme.txt&quot;);
  
      // Read the file.
      String contents = await file.readAsString();
  
      return int.parse(contents);
    } catch (e) {
      // If encountering an error, return 0.
      print(e);
    }
  }
  </code></pre>
  <p>I add this code in android&gt;app&gt;src&gt;main&gt;AndroidMainfest.xml</p>
  <pre><code>&lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot; /&gt;
  </code></pre>
  <p>I also add the asset folder in pubspec.yaml</p>
  <pre><code>flutter:
  
    # The following line ensures that the Material Icons font is
    # included with your application, so that you can use the icons in
    # the material Icons class.
    uses-material-design: true
  
    # To add assets to your application, add an assets section, like this:
    assets:
      - assets/
  </code></pre>