Skip to content

Commit

Permalink
Test debug
Browse files Browse the repository at this point in the history
```
[E] [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(Invalid operation, The webview instance has not been initialized.
 Fail to create ecore evas.
 Fail to create ewk_view., null, null)
 #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651)
 #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322)
<asynchronous suspension>

```
  • Loading branch information
JSUYA committed Jan 8, 2024
1 parent f2c3a71 commit 1f8525f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/webview_flutter/tizen/src/webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,15 @@ void WebView::InitWebView() {
chromium_argv);

ewk_init();
Ecore_Evas* evas = ecore_evas_new("wayland_egl", 0, 0, 1, 1, 0);
Ecore_Evas* evas = nullptr; // ecore_evas_new("wayland_egl", 0, 0, 1, 1, 0);
if (!evas) {
debug_log_ += "\n Fail to create ecore evas.";
}

webview_instance_ = ewk_view_add(ecore_evas_get(evas));
webview_instance_ = nullptr; // ewk_view_add(ecore_evas_get(evas));
if (!webview_instance_) {
debug_log_ += "\n Fail to create ewk_view.";
}
ecore_evas_focus_set(evas, true);
ewk_view_focus_set(webview_instance_, true);
EwkInternalApiBinding::GetInstance().view.OffscreenRenderingEnabledSet(
Expand Down Expand Up @@ -351,8 +357,9 @@ void WebView::InitWebView() {
void WebView::HandleWebViewMethodCall(const FlMethodCall& method_call,
std::unique_ptr<FlMethodResult> result) {
if (!webview_instance_) {
result->Error("Invalid operation",
"The webview instance has not been initialized.");
result->Error(
"Invalid operation",
"The webview instance has not been initialized.\n" + debug_log_);
return;
}

Expand Down
2 changes: 2 additions & 0 deletions packages/webview_flutter/tizen/src/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class WebView : public PlatformView {
std::unique_ptr<flutter::TextureVariant> texture_variant_;
std::mutex mutex_;
std::unique_ptr<BufferPool> tbm_pool_;

std::string debug_log_;
};

#endif // FLUTTER_PLUGIN_WEBVIEW_H_

0 comments on commit 1f8525f

Please sign in to comment.