I am trying to display local files using webview (if there is other option, it is welcomed, but I am trying to display not just pdf. I want to display pdf,xlsx,docx).
I am suppliying url with file://...
, first it gived me access denied error with both flutter_webview_plugin
and webview_flutter
plugin. then I edited the source code of both of plugins and congiured setAllowFileAccessFromFileURLs
as true according to this reference but this time it just shows white blank page to me. And there is strange warning in the console (this warning was shown even before I edit the source code.)
warning:
W/m.packagename(31636): Couldn't lock the profile file /data/user/0/packagename/app_tbs_64/core_share/oat/tbs_sdk_extension_dex.jar.cur.prof: Failed to open file '/data/user/0/packagename/app_tbs_64/core_share/oat/tbs_sdk_extension_dex.jar.cur.prof': No such file or directory W/m.gekapp.gekap(31636): Could not forcefully load profile /data/user/0/packagename/app_tbs_64/core_share/oat/tbs_sdk_extension_dex.jar.cur.prof
I am using Android 11 on the phone I think that might be the issue. (There is no problem on the iOS I can display the files using file://...
)
flutter doctor --verbose
[✓] Flutter (Channel stable, 2.2.0, on macOS 11.3 20E232 darwin-arm, locale en-TR)
• Flutter version 2.2.0 at /Users/burakcabadan/development/flutter
• Framework revision b22742018b (4 weeks ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/burakcabadan/Library/Android/sdk
• Platform android-30, build-tools 30.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_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• 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 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 55.1.5
• Dart plugin version 211.7233
[✓] VS Code (version 1.56.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.23.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 11.3 20E232 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.77
• No issues found!