fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 933 forks source link

JavascriptChannel in Normal in debug mode, not working in release mode #922

Open shenlanchenwei opened 3 years ago

shenlanchenwei commented 3 years ago

image Issue occurs on: Android Plugin version:4.0

There is no postMessage method in release mode

image

There is a postMessage method in debug mode image

hacjy commented 3 years ago

I have same question.

shenlanchenwei commented 3 years ago

I have same question.

Android obfuscation program causes this problem, closing it can solve this problem

hacjy commented 3 years ago

Thank you ! @shenlanchenwei Turn off obfuscation or add the code "- keep class com.fluent webview Plugin. {*;}" in the obfuscation file, this problem is solved.

shenlanchenwei commented 2 years ago

The namespace is not "com.fluent webview Plugin", it should be "-keep class com.flutter_webviewplugin.* { ; }" ^^