ITADN

[Linux] Compilation error: undefined reference to `webkit_web_view_get_theme_color` on WebKit < 2.50

#2780Opensseu-buhzzi 创建于 2026-02-15
bug
S
sseu-buhzzicommented
### Is there an existing issue for this? - [x] I have searched the existing issues ### Current Behavior When building the `flutter_inappwebview_linux` plugin on a system with an older WebKit/WPE version (specifically versions below 2.50), the compilation fails with an "use of undeclared identifier" error for the function `webkit_web_view_get_theme_color`. ``` flutter_inappwebview/flutter_inappwebview_linux/example/linux/flutter/ephemeral/.plugin_symlinks/flutter_inappwebview_linux/linux/in_app_webview/in_app_webview.cc:6214:23: error: use of undeclared identifier 'webkit_web_view_get_theme_color' ``` ### Expected Behavior The `getMetaThemeColor` feature should be conditionally compiled so that it is only enabled when the underlying WebKit headers support the `webkit_web_view_get_theme_color` API. ### Steps with code example to reproduce <details> <summary>Steps to reproduce</summary> 1. Use a Linux distribution with WPEWebKit webkit version < 2.50. 2. Go to `flutter_inappwebview_linux/example` in this repo. 3. Run `flutter build linux`. 4. The build process fails during the C++ compilation of the `flutter_inappwebview_linux` package. </details> ### Stacktrace/Logs <details> <summary>Stacktrace/Logs</summary> ``` flutter_inappwebview/flutter_inappwebview_linux/example/linux/flutter/ephemeral/.plugin_symlinks/flutter_inappwebview_linux/linux/in_app_webview/in_app_webview.cc:6214:23: error: use of undeclared identifier 'webkit_web_view_get_theme_color' Building Linux application... Build process failed ``` </details> ### Flutter version v3.41.1 ### Operating System, Device-specific and/or Tool Linux debian 6.12.63+deb13-amd64 libwpewebkit-2.0-dev/stable,now 2.48.3-1 amd64 ### Plugin version v6.2.0-beta.3 ### Additional information The API `webkit_web_view_get_them_color` is available since 2.50. https://github.com/WebKit/WebKit/blob/b8fb341d225d73ae242173579bba732fc2c1ca5d/Source/WebKit/UIProcess/API/wpe/WebKitWebViewWPE.cpp#L333-L359 ### Self grab - [x] I'm ready to work on this issue!
0 条评论