title: Emulator crashes with lost connection to device while trying to read pdf
body: <p>I have a following screen, that gets a pdf or file from the next page. But when I try to read PDF, the emulator crashes with 'Lost Connection to Device' and following error. I am using advanced_pdf_viewer for reading the pdf. This issue is only with android and not ios</p>
  <p>Error : I/System.out( 5829): Already closed
  W/System.err( 5829): java.lang.IllegalStateException: Already closed
  D/PdfViewerPlugin( 5829): Retrieving page failed.
  D/AndroidRuntime( 5829): Shutting down VM
  E/flutter ( 5829): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method getPage on channel flutter_plugin_pdf_viewer)</p>
  <pre><code>class FilePage extends StatefulWidget {
    const FilePage({this.file, this.isImage = false});
    final FirebaseFile? file;
    final isImage;
    @override
    _FilePageState createState() =&gt; _FilePageState();
  }
  
  class _FilePageState extends State&lt;FilePage&gt; {
    @override
    void initState() {
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      //final isPdf = ['.pdf', 'pdf', '.PDF', 'PDF'].any(file.name.contains);
      //final isEpub = ['.epub'].any(file.name.contains);
      // final isImg = ['.jpg', '.JPG', '.png', '.PNG', '.jpeg', '.JPEG']
      //   .any(file.name.contains);
      //  int _totalPages=0;
      //   int _currentPage=0;
      //   bool pdfReady=false;
      //   PDFViewController _pdfViewController;
  
      //initState(){
      return WillPopScope(
        onWillPop: () async =&gt; true,
        child: Scaffold(
          appBar: AppBar(
            backgroundColor: Colors.indigo[900],
            title: Text(widget.file!.name.split('.').first),
            centerTitle: true,
          ),
          body: FutureBuilder(
              future: PDFDocument.fromURL(widget.file!.url),
              builder: (context, snapshot) {
                switch (snapshot.connectionState) {
                  case ConnectionState.waiting:
                  case ConnectionState.active:
                    return Center(
                      child: CircularProgressIndicator(),
                    );
                  default:
                    var pdf = snapshot.data as PDFDocument;
                    return PDFViewer(document: pdf);
                }
              }),
        ),
      );
    }
  }
  </code></pre>