I'm building a flutter app on windows, i have tried different packages for in app web view like flutter_inappwebview and webview_cef.
The problem is when the application goes to the webview screen , the application get killed on the tester machine (the app closes unexpectedly).
i don't know why or what i have missed, it's working on my machine but closes on tester machine.
Although the recommended way to initialize the web view is applied within the initiate method of the webview screen :
void initState(){
super.initState();
initiate();
}
void initiate()async{
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.windows) {
final availableVersion = await WebViewEnvironment.getAvailableVersion();
assert(availableVersion != null,
'Failed to find an installed WebView2 runtime or non-stable Microsoft Edge installation.');
webViewEnvironment = await WebViewEnvironment.create(
settings: WebViewEnvironmentSettings(userDataFolder: 'custom_path'));
}
if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) {
await InAppWebViewController.setWebContentsDebuggingEnabled(kDebugMode);
}
}
I was suspecting that the custom_path is the reason, because it's within Program Files folder and this folder isn't writable. read only , so the OS may kill the app, but when changed to system temporary the app still get killed using both packages.