title: Flutter app crash on release mode reading PDF
body: <p>I have a pdf reader in my app, with this function I get de pdf from URL and save the file in local path</p>
  
  <pre><code>  Future&lt;File&gt; getFileFromUrl(String url) async {
      try {
        var data = await http.get(url);
        var bytes = data.bodyBytes;
        var dir = await getApplicationSupportDirectory();
        File file = File("${dir.path}/some.pdf");
  
        File urlFile = await file.writeAsBytes(bytes);
        return urlFile;
      } catch (e) {
        throw Exception("Error opening url file");
      }
    }
  </code></pre>
  
  <p>After this process, I call a class to show this PDF in a new route</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_pdfview/flutter_pdfview.dart';
  
  class CustomPdfView extends StatefulWidget {
    final String title;
    final String urlPdf;
  
    CustomPdfView(
      this.title,
      this.urlPdf
    );
  
    @override
    _CustomPdfViewState createState() =&gt; _CustomPdfViewState();
  }
  
  class _CustomPdfViewState extends State&lt;CustomPdfView&gt; {
    //int _totalPages = 0;
    //int _currentPage = 0;
    bool pdfReady = false;
    //PDFViewController _pdfViewController;
  
    @override
    Widget build(BuildContext context) {
      print('Aqui entra antes: ${widget.urlPdf}');
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Stack(
          children: &lt;Widget&gt;[
            PDFView(
              filePath: widget.urlPdf,
              autoSpacing: true,
              enableSwipe: true,
              pageSnap: true,
              swipeHorizontal: true,
              nightMode: false,
              onError: (e) {
                print("error $e");
              },
              onRender: (_pages) {
                setState(() {
                  //_totalPages = _pages;
                  pdfReady = true;
                });
              },
              onViewCreated: (PDFViewController vc) {
                //_pdfViewController = vc;
              },
              onPageChanged: (int page, int total) {
                setState(() {});
              },
              onPageError: (page, e) {},
            ),
            !pdfReady
                ? Center(
                    child: CircularProgressIndicator(),
                  )
                : Offstage()
          ],
        ),
      );
    }
  }
  </code></pre>
  
  <p>All works fine in debug mode, but when I run my app on release, the app crashes in CustomPdfView.</p>
  
  <p>I don't know what is the error, I already added, STORAGE permissions in my /app/src/main/AndroidManifest.xml</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>And I don't know how can I get error line in the console, because the app is running on release.</p>