efortuna/wiki_browser

Unable to open pdf link in webview

Closed this issue · 1 comments

DK15 commented

@efortuna I am using this plugin webview_flutter to open a pdf link which works properly on iOS, but on Android, I am getting below error:

No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp

I am using Android emulator (Nexus 6P, OS: Marshmallow).

If I understand correctly, above error is related to runtime permissions being required on Android for api > = 23.
Would you know how to give required permissions to address this issue ? Or any workaround that'll help to open pdf using this plugin ?

This is how I am using the webview plugin as a sample:


class _MyHomePageState extends State<MyHomePage> {

  Completer<WebViewController> _controller = Completer<WebViewController>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          title: Text('WebView Demo')
      ),
      body: WebView(
        initialUrl: 'http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf',
        javascriptMode: JavascriptMode.unrestricted,
        onWebViewCreated: (WebViewController webViewController) {
          _controller.complete(webViewController);
        },
      ),
    );
  }
}

Flutter doctor:


[✓] Flutter (Channel beta, v0.11.10, on Mac OS X 10.13.6 17G65, locale en-US)
    • Flutter version 0.11.10 at
      /Users/deeptibelsare/Documents/DarshanUdacity/Flutter/flutter
    • Framework revision c27c4a265e (3 months ago), 2018-11-26 17:07:24 -0500
    • Engine revision eebc6a5895
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/deeptibelsare/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1024-b01)
    ✗ Android license status unknown.

[!] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    ✗ Verify that all connected devices have been paired with this computer in
      Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may
      require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 2.0.0
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1024-b01)

[✓] Connected device (2 available)
    • Android SDK built for x86 • emulator-5554                        •
      android-x86 • Android 6.0 (API 23) (emulator)
    • iPhone 8                  • FB2DF839-2E8D-44E0-90B8-CCA0F138C932 • ios
      • iOS 11.4 (simulator)

! Doctor found issues in 2 categories.
DK15 commented

Please disregard above issue. It was Android emulator issue.