Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView is not allowed in privileged processes #486

Closed
sanrixue opened this issue Jul 23, 2019 · 3 comments
Closed

WebView is not allowed in privileged processes #486

sanrixue opened this issue Jul 23, 2019 · 3 comments

Comments

@sanrixue
Copy link

E/MethodChannel#flutter_webview_plugin: Failed to handle method call
java.lang.UnsupportedOperationException: For security reasons, WebView is not allowed in privileged processes
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:187)
at android.webkit.WebView.getFactory(WebView.java:2530)
at android.webkit.WebView.ensureProviderCreated(WebView.java:2525)
at android.webkit.WebView.setOverScrollMode(WebView.java:2590)
at android.view.View.(View.java:4574)
at android.view.View.(View.java:4706)
at android.view.ViewGroup.(ViewGroup.java:597)
at android.widget.AbsoluteLayout.(AbsoluteLayout.java:55)
at android.webkit.WebView.(WebView.java:643)
at android.webkit.WebView.(WebView.java:588)
at android.webkit.WebView.(WebView.java:571)
at android.webkit.WebView.(WebView.java:558)
at android.webkit.WebView.(WebView.java:548)
at com.flutter_webview_plugin.ObservableWebView.(ObservableWebView.java:17)
at com.flutter_webview_plugin.WebviewManager.(WebviewManager.java:84)
at com.flutter_webview_plugin.FlutterWebviewPlugin.openUrl(FlutterWebviewPlugin.java:93)
at com.flutter_webview_plugin.FlutterWebviewPlugin.onMethodCall(FlutterWebviewPlugin.java:42)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188)
at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:142)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
D/SessLogManager: no log right row, slow the process thread.
E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, For security reasons, WebView is not allowed in privileged processes, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)

#2 FlutterWebviewPlugin.launch (package:flutter_webview_plugin/src/base.dart:137:20)

#3 _WebviewScaffoldState.build (package:flutter_webview_plugin/src/webview_scaffold.dart:71:24)
#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:3825:27)
#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3736:15)
#6 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
#7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
#8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)
#9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
#10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#11 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#12 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
#13 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
#14 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
#15 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)
#16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
#17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#18 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#19 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
#20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#21 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#22 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
#23 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
#24 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
#25 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
#26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#27 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#28 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
#29 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#30 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#31 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
#32 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#33 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#34 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
#35 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#36 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#37 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4876:14)
#38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
#39 Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
#40 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
#41 Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
#42 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3716:5)
#43 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3864:11)
#44 ComponentEle

@charafau
Copy link
Collaborator

need more info

@atheist1
Copy link

the same issue.
the system is android 7.1 and above are my code

import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';


import '../common/model/Source.dart';


class WebResWidget extends StatefulWidget {
  Source source;
  Size size;

  WebResWidget({Key key, this.source, this.size}) : super(key: key);

  @override
  _WebResWidgetState createState() => _WebResWidgetState();
}

class _WebResWidgetState extends State<WebResWidget> {
  final flutterWebViewPlugin = FlutterWebviewPlugin();
 
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  void dispose() {
    // TODO: implement dispose
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return WebviewScaffold(url: 'http://192.168.1.58:8090/#/login');
  }
}

the flutter doctor returns

[✓] Flutter (Channel unknown, v1.14.6, on Mac OS X 10.14.4 18E226, locale
    zh-Hans-CN)
    • Flutter version 1.14.6 at /Users/qitianle/Desktop/flutter
    • Framework revision fabeb2a16f (3 months ago), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/qitianle/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /Users/qitianle/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ CocoaPods installed but not initialized.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To initialize CocoaPods, run:
        pod setup
      once to finalize CocoaPods' installation.

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.9.1

[✓] Connected device (1 available)
    • mooncell box • K8WGLY25AS                               • android-arm •
      Android 7.1.2 (API 25)
      iOS 13.4.1

the version is 0.3.11

@mikaelzero
Copy link

same issue version 0.3.0+2

@sanrixue sanrixue closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants