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

runtime issue of SecTrustCopyExceptions 'This method should not be called on the main thread as it may lead to UI unresponsiveness.' when using onReceivedServerTrustAuthRequest #1924

Closed
2 tasks done
Hilbert2048 opened this issue Dec 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Hilbert2048
Copy link

Hilbert2048 commented Dec 18, 2023

  • I have read the Getting Started section
  • I have already searched for the same problem

Environment

Technology Version
Flutter version
Plugin version
Android version
iOS version
macOS version
Xcode version
Google Chrome version

Device information:

Description

Expected behavior:

Current behavior:

Steps to reproduce

1、based on the source code of the InAppWebview default example (in_app_webiew_example.screen.dart file)

(1) change the url of initialUrlRequest to

'https://so.toutiao.com/search?keyword=%E8%BF%AA%E4%B8%BD%E7%83%AD%E5%B7%B4'

(2) add onReceivedServerTrustAuthRequest callback implementation

    onReceivedServerTrustAuthRequest:
                      (controller, challenge) async {
                    return ServerTrustAuthResponse(
                        action: ServerTrustAuthResponseAction.PROCEED);
                  },

2、run the InAppWebView demo from xcode, and enable the "All Runtime issues" breadkpoint of XCode

breakpoints

3、Here is the full source code of the reproduction version of in_app_webiew_example.screen.dart file

import 'dart:collection';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';

import 'main.dart';

class InAppWebViewExampleScreen extends StatefulWidget {
  @override
  _InAppWebViewExampleScreenState createState() =>
      _InAppWebViewExampleScreenState();
}

class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
  final GlobalKey webViewKey = GlobalKey();

  InAppWebViewController? webViewController;
  InAppWebViewSettings settings = InAppWebViewSettings(
    isInspectable: kDebugMode,
    mediaPlaybackRequiresUserGesture: false,
    allowsInlineMediaPlayback: true,
    iframeAllow: "camera; microphone",
    iframeAllowFullscreen: true,
    allowsBackForwardNavigationGestures: true,
  );

  PullToRefreshController? pullToRefreshController;

  late ContextMenu contextMenu;
  String url = "";
  double progress = 0;
  final urlController = TextEditingController();

  @override
  void initState() {
    super.initState();

    contextMenu = ContextMenu(
        menuItems: [
          ContextMenuItem(
              id: 1,
              title: "Special",
              action: () async {
                print("Menu item Special clicked!");
                print(await webViewController?.getSelectedText());
                await webViewController?.clearFocus();
              })
        ],
        settings: ContextMenuSettings(hideDefaultSystemContextMenuItems: false),
        onCreateContextMenu: (hitTestResult) async {
          print("onCreateContextMenu");
          print(hitTestResult.extra);
          print(await webViewController?.getSelectedText());
        },
        onHideContextMenu: () {
          print("onHideContextMenu");
        },
        onContextMenuActionItemClicked: (contextMenuItemClicked) async {
          var id = contextMenuItemClicked.id;
          print("onContextMenuActionItemClicked: " +
              id.toString() +
              " " +
              contextMenuItemClicked.title);
        });

    pullToRefreshController = kIsWeb ||
            ![TargetPlatform.iOS, TargetPlatform.android]
                .contains(defaultTargetPlatform)
        ? null
        : PullToRefreshController(
            settings: PullToRefreshSettings(
              color: Colors.blue,
            ),
            onRefresh: () async {
              if (defaultTargetPlatform == TargetPlatform.android) {
                webViewController?.reload();
              } else if (defaultTargetPlatform == TargetPlatform.iOS ||
                  defaultTargetPlatform == TargetPlatform.macOS) {
                webViewController?.loadUrl(
                    urlRequest:
                        URLRequest(url: await webViewController?.getUrl()));
              }
            },
          );
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text("InAppWebView")),
        drawer: myDrawer(context: context),
        body: SafeArea(
            child: Column(children: <Widget>[
          TextField(
            decoration: InputDecoration(prefixIcon: Icon(Icons.search)),
            controller: urlController,
            keyboardType: TextInputType.text,
            onSubmitted: (value) {
              var url = WebUri(value);
              if (url.scheme.isEmpty) {
                url = WebUri((!kIsWeb
                        ? "https://www.google.com/search?q="
                        : "https://www.bing.com/search?q=") +
                    value);
              }
              webViewController?.loadUrl(urlRequest: URLRequest(url: url));
            },
          ),
          Expanded(
            child: Stack(
              children: [
                InAppWebView(
                  key: webViewKey,
                  initialUrlRequest: URLRequest(
                      url: WebUri(
                          'https://so.toutiao.com/search?keyword=%E8%BF%AA%E4%B8%BD%E7%83%AD%E5%B7%B4')),
                  // initialUrlRequest:
                  // URLRequest(url: WebUri(Uri.base.toString().replaceFirst("/#/", "/") + 'page.html')),
                  // initialFile: "assets/index.html",
                  initialUserScripts: UnmodifiableListView<UserScript>([]),
                  initialSettings: settings,
                  contextMenu: contextMenu,
                  pullToRefreshController: pullToRefreshController,
                  onWebViewCreated: (controller) async {
                    webViewController = controller;
                  },
                  onLoadStart: (controller, url) async {
                    setState(() {
                      this.url = url.toString();
                      urlController.text = this.url;
                    });
                  },
                  onPermissionRequest: (controller, request) async {
                    return PermissionResponse(
                        resources: request.resources,
                        action: PermissionResponseAction.GRANT);
                  },
                  shouldOverrideUrlLoading:
                      (controller, navigationAction) async {
                    var uri = navigationAction.request.url!;

                    if (![
                      "http",
                      "https",
                      "file",
                      "chrome",
                      "data",
                      "javascript",
                      "about"
                    ].contains(uri.scheme)) {
                      if (await canLaunchUrl(uri)) {
                        // Launch the App
                        await launchUrl(
                          uri,
                        );
                        // and cancel the request
                        return NavigationActionPolicy.CANCEL;
                      }
                    }

                    return NavigationActionPolicy.ALLOW;
                  },
                  onLoadStop: (controller, url) async {
                    pullToRefreshController?.endRefreshing();
                    setState(() {
                      this.url = url.toString();
                      urlController.text = this.url;
                    });
                  },
                  onReceivedError: (controller, request, error) {
                    pullToRefreshController?.endRefreshing();
                  },
                  onProgressChanged: (controller, progress) {
                    if (progress == 100) {
                      pullToRefreshController?.endRefreshing();
                    }
                    setState(() {
                      this.progress = progress / 100;
                      urlController.text = this.url;
                    });
                  },
                  onUpdateVisitedHistory: (controller, url, isReload) {
                    setState(() {
                      this.url = url.toString();
                      urlController.text = this.url;
                    });
                  },
                  onReceivedServerTrustAuthRequest:
                      (controller, challenge) async {
                    return ServerTrustAuthResponse(
                        action: ServerTrustAuthResponseAction.PROCEED);
                  },

                  onConsoleMessage: (controller, consoleMessage) {
                    print(consoleMessage);
                  },
                ),
                progress < 1.0
                    ? LinearProgressIndicator(value: progress)
                    : Container(),
              ],
            ),
          ),
          ButtonBar(
            alignment: MainAxisAlignment.center,
            children: <Widget>[
              ElevatedButton(
                child: Icon(Icons.arrow_back),
                onPressed: () {
                  webViewController?.goBack();
                },
              ),
              ElevatedButton(
                child: Icon(Icons.arrow_forward),
                onPressed: () {
                  webViewController?.goForward();
                },
              ),
              ElevatedButton(
                child: Icon(Icons.refresh),
                onPressed: () {
                  webViewController?.reload();
                },
              ),
            ],
          ),
        ])));
  }
}
  1. This
  2. Than that
  3. Then

Images

crash

Stacktrace/Logcat

(lldb) bt all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x0000000190ab0c80 CoreFoundation`CF_IS_OBJC + 120
    frame #1: 0x0000000190ac0850 CoreFoundation`CFHash + 128
    frame #2: 0x0000000190ac0030 CoreFoundation`___CFBasicHashFindBucket_Linear + 112
    frame #3: 0x0000000190abb5f4 CoreFoundation`CFSetGetValue + 148
    frame #4: 0x0000000190adf520 CoreFoundation`__CFRunLoopCopyMode + 148
    frame #5: 0x0000000190b10950 CoreFoundation`CFRunLoopTimerSetNextFireDate + 420
    frame #6: 0x0000000106809b6c Flutter`fml::MessageLoopImpl::FlushTasks(fml::FlushType) + 212
    frame #7: 0x000000010680e0ac Flutter`fml::MessageLoopDarwin::OnTimerFire(__CFRunLoopTimer*, fml::MessageLoopDarwin*) + 32
    frame #8: 0x0000000190b573ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
    frame #9: 0x0000000190b57094 CoreFoundation`__CFRunLoopDoTimer + 1004
    frame #10: 0x0000000190ae0c84 CoreFoundation`__CFRunLoopDoTimers + 288
    frame #11: 0x0000000190addc9c CoreFoundation`__CFRunLoopRun + 1856
    frame #12: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #13: 0x00000001d405e4f8 GraphicsServices`GSEventRunModal + 164
    frame #14: 0x0000000192f0162c UIKitCore`-[UIApplication _run] + 888
    frame #15: 0x0000000192f00c68 UIKitCore`UIApplicationMain + 340
    frame #16: 0x00000001023cc6ac Runner`main at AppDelegate.swift:7:13
    frame #17: 0x00000001b3816dcc dyld`start + 2240
  thread #2
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #3
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #4
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
* thread #5, queue = 'Runtime Issue Logging', stop reason = breakpoint 3.1
  * frame #0: 0x00000001aa33fd0c libsystem_trace.dylib`os_log_fault_default_callback
    frame #1: 0x00000001aa33f984 libsystem_trace.dylib`_os_log_invoke_callback + 204
    frame #2: 0x00000001aa33d714 libsystem_trace.dylib`_os_log_impl_flatten_and_send + 6956
    frame #3: 0x00000001aa33bbd0 libsystem_trace.dylib`_os_log + 152
    frame #4: 0x00000001aa3442d4 libsystem_trace.dylib`_os_log_fault_impl + 24
    frame #5: 0x0000000199453168 Security`__SecTrustEvaluateThreadRuntimeCheck_block_invoke_2 + 444
    frame #6: 0x00000001031e4f50 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #7: 0x00000001031e6b34 libdispatch.dylib`_dispatch_client_callout + 20
    frame #8: 0x00000001031ee98c libdispatch.dylib`_dispatch_lane_serial_drain + 832
    frame #9: 0x00000001031ef728 libdispatch.dylib`_dispatch_lane_invoke + 408
    frame #10: 0x00000001031fc5f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 328
    frame #11: 0x00000001031fbc2c libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #12: 0x00000001faacf964 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #6, queue = 'com.apple.libtrace.state.block-list'
    frame #0: 0x00000001d8209bf8 libsystem_kernel.dylib`__ulock_wait + 8
    frame #1: 0x00000001031e76b0 libdispatch.dylib`_dlock_wait + 56
    frame #2: 0x00000001031e7464 libdispatch.dylib`_dispatch_thread_event_wait_slow + 56
    frame #3: 0x00000001031f8488 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 384
    frame #4: 0x00000001031f7dc0 libdispatch.dylib`_dispatch_sync_f_slow + 184
    frame #5: 0x00000001aa345844 libsystem_trace.dylib`___os_state_request_for_self_block_invoke + 372
    frame #6: 0x00000001031e4f50 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #7: 0x00000001031e6b34 libdispatch.dylib`_dispatch_client_callout + 20
    frame #8: 0x00000001031ee98c libdispatch.dylib`_dispatch_lane_serial_drain + 832
    frame #9: 0x00000001031ef75c libdispatch.dylib`_dispatch_lane_invoke + 460
    frame #10: 0x00000001031fc5f8 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 328
    frame #11: 0x00000001031fbc2c libdispatch.dylib`_dispatch_workloop_worker_thread + 444
    frame #12: 0x00000001faacf964 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #7
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #8, name = 'com.apple.uikit.eventfetch-thread'
    frame #0: 0x00000001d8209178 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x00000001d8208f10 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001d8208e28 libsystem_kernel.dylib`mach_msg_overwrite + 436
    frame #3: 0x00000001d8208c68 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000190adfb1c CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x0000000190adda14 CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x000000018fa7048c Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
    frame #8: 0x000000018fa9d74c Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 64
    frame #9: 0x0000000192e634a8 UIKitCore`-[UIEventFetcher threadMain] + 420
    frame #10: 0x000000018faf3de0 Foundation`__NSThread__start__ + 732
    frame #11: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #9, name = 'io.flutter.1.ui'
    frame #0: 0x00000001d8209178 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x00000001d8208f10 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001d8208e28 libsystem_kernel.dylib`mach_msg_overwrite + 436
    frame #3: 0x00000001d8208c68 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000190adfb1c CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x0000000190adda14 CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x000000010680e198 Flutter`fml::MessageLoopDarwin::Run() + 88
    frame #8: 0x000000010680cc60 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*) + 208
    frame #9: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #10, name = 'io.flutter.1.raster'
    frame #0: 0x00000001d8209178 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x00000001d8208f10 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001d8208e28 libsystem_kernel.dylib`mach_msg_overwrite + 436
    frame #3: 0x00000001d8208c68 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000190adfb1c CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x0000000190adda14 CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x000000010680e198 Flutter`fml::MessageLoopDarwin::Run() + 88
    frame #8: 0x000000010680cc60 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*) + 208
    frame #9: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #11, name = 'io.flutter.1.io'
    frame #0: 0x00000001d8209178 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x00000001d8208f10 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001d8208e28 libsystem_kernel.dylib`mach_msg_overwrite + 436
    frame #3: 0x00000001d8208c68 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000190adfb1c CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x0000000190adda14 CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x000000010680e198 Flutter`fml::MessageLoopDarwin::Run() + 88
    frame #8: 0x000000010680cc60 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*) + 208
    frame #9: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #12, name = 'io.flutter.1.profiler'
    frame #0: 0x00000001d8209178 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x00000001d8208f10 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001d8208e28 libsystem_kernel.dylib`mach_msg_overwrite + 436
    frame #3: 0x00000001d8208c68 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000190adfb1c CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x0000000190adda14 CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x0000000190add478 CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x000000010680e198 Flutter`fml::MessageLoopDarwin::Run() + 88
    frame #8: 0x000000010680cc60 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::Thread::Thread(std::_LIBCPP_ABI_NAMESPACE::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>>(void*) + 208
    frame #9: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #13, name = 'io.worker.1'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #14, name = 'io.worker.2'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #15, name = 'io.worker.3'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #16, name = 'io.worker.4'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #17, name = 'io.worker.5'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #18, name = 'io.worker.6'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #19, name = 'dart:io EventHandler'
    frame #0: 0x00000001d8216f0c libsystem_kernel.dylib`kevent + 8
    frame #1: 0x0000000106aa67cc Flutter`dart::bin::EventHandlerImplementation::EventHandlerEntry(unsigned long) + 400
    frame #2: 0x0000000106ad4918 Flutter`dart::bin::ThreadStart(void*) + 88
    frame #3: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #20, name = 'DartWorker'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacf000 libsystem_pthread.dylib`_pthread_cond_wait + 1272
    frame #2: 0x0000000106c43e60 Flutter`dart::Monitor::WaitMicros(long long) + 128
    frame #3: 0x0000000106cd5aa0 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
    frame #4: 0x0000000106c4381c Flutter`dart::ThreadStart(void*) + 312
    frame #5: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #21, name = 'io.worker.1'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #22, name = 'io.worker.2'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #23, name = 'io.worker.3'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #24, name = 'io.worker.4'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000106575998 Flutter`std::_LIBCPP_ABI_NAMESPACE::condition_variable::wait(std::_LIBCPP_ABI_NAMESPACE::unique_lock<std::_LIBCPP_ABI_NAMESPACE::mutex>&) + 20
    frame #3: 0x0000000106806e34 Flutter`void* std::_LIBCPP_ABI_NAMESPACE::__thread_proxy[abi:v15000]<std::_LIBCPP_ABI_NAMESPACE::tuple<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<std::_LIBCPP_ABI_NAMESPACE::__thread_struct, std::_LIBCPP_ABI_NAMESPACE::default_delete<std::_LIBCPP_ABI_NAMESPACE::__thread_struct>>, fml::ConcurrentMessageLoop::ConcurrentMessageLoop(unsigned long)::$_0>>(void*) + 348
    frame #4: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #25, name = 'DartWorker'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacf000 libsystem_pthread.dylib`_pthread_cond_wait + 1272
    frame #2: 0x0000000106c43e60 Flutter`dart::Monitor::WaitMicros(long long) + 128
    frame #3: 0x0000000106cd5aa0 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
    frame #4: 0x0000000106c4381c Flutter`dart::ThreadStart(void*) + 312
    frame #5: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #26, name = 'DartWorker'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacf000 libsystem_pthread.dylib`_pthread_cond_wait + 1272
    frame #2: 0x0000000106c43e60 Flutter`dart::Monitor::WaitMicros(long long) + 128
    frame #3: 0x0000000106cd5aa0 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 668
    frame #4: 0x0000000106c4381c Flutter`dart::ThreadStart(void*) + 312
    frame #5: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #27
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #28
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #29
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #30, name = 'DartWorker'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacf000 libsystem_pthread.dylib`_pthread_cond_wait + 1272
    frame #2: 0x0000000106c43e60 Flutter`dart::Monitor::WaitMicros(long long) + 128
    frame #3: 0x0000000106b6e8f4 Flutter`dart::MutatorThreadPool::OnEnterIdleLocked(dart::MonitorLocker*) + 480
    frame #4: 0x0000000106cd5ad4 Flutter`dart::ThreadPool::Worker::Main(unsigned long) + 720
    frame #5: 0x0000000106c4381c Flutter`dart::ThreadStart(void*) + 312
    frame #6: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #31, name = 'JavaScriptCore libpas scavenger'
    frame #0: 0x00000001d8209b1c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001faacefd4 libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x00000001a7ab30f4 JavaScriptCore`scavenger_thread_main + 1316
    frame #3: 0x00000001faad04d4 libsystem_pthread.dylib`_pthread_start + 136
  thread #32
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #33
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
  thread #34
    frame #0: 0x00000001faacf9fc libsystem_pthread.dylib`start_wqthread
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
This method should not be called on the main thread as it may lead to UI unresponsiveness.
@Hilbert2048 Hilbert2048 added the bug Something isn't working label Dec 18, 2023
Copy link

👋 @Hilbert2048

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@pichillilorenzo pichillilorenzo changed the title runtime issue of SecTrustCopyExceptions, and "This method should not be called on the main thread as it may lead to UI unresponsiveness." runtime issue of SecTrustCopyExceptions "This method should not be called on the main thread as it may lead to UI unresponsiveness." when using onReceivedServerTrustAuthRequest Dec 23, 2023
@pichillilorenzo pichillilorenzo changed the title runtime issue of SecTrustCopyExceptions "This method should not be called on the main thread as it may lead to UI unresponsiveness." when using onReceivedServerTrustAuthRequest runtime issue of SecTrustCopyExceptions 'This method should not be called on the main thread as it may lead to UI unresponsiveness.' when using onReceivedServerTrustAuthRequest Dec 23, 2023
ps9310 pushed a commit to mayank4741/flutter_inappwebview that referenced this issue Feb 24, 2024
Copy link

github-actions bot commented Oct 5, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant