uni-app iOS13适配WKWebview必现崩溃问题 PDRCoreApp.m兼容性bug报错(已解决)

uni-app iOS13适配WKWebview必现崩溃问题 PDRCoreApp.m兼容性bug报错(已解决)

Thread 0 Crashed:
0   libobjc.A.dylib                 0x00000001b741c050 objc_msgSend   16
1   EZView                          0x000000010288214c -[PDRCoreApp handleCmds:]   6332748 (PDRCoreApp.m:2874)
2   EZView                          0x0000000102855948 -[H5WEWKWebview webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:]   6150472 (H5WEWKWebview.m:635)
3   WebKit                          0x00000001bef4d338 WebKit::UIDelegate::UIClient::runJavaScriptPrompt(WebKit::WebPageProxy*, WTF::String const

更多关于uni-app iOS13适配WKWebview必现崩溃问题 PDRCoreApp.m兼容性bug报错(已解决)的实战教程也可以访问 https://www.itying.com/category-93-b0.html

10 回复

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x0000000188200050 objc_msgSend + 16 1 EZView 0x00000001028a52e0 -[PDRCoreApp handleCmds:] + 6116064 (PDRCoreApp.m:2645) 2 EZView 0x00000001028c5f80 26-[H5WEUIWebview regPlusGo]block_invoke + 6250368 (H5WEUIWebview.m:184) 3 CoreFoundation 0x00000001884f0724 invoking + 148 4 CoreFoundation 0x00000001883b9280 -[NSInvocation invoke] + 344 5 JavaScriptCore 0x00000001976f8344 JSC::ObjCCallbackFunctionImpl::call+ 2618180 (JSContext, OpaqueJSValue, unsigned long, OpaqueJSValue const const, OpaqueJSValue const*) + 408 6 JavaScriptCore 0x00000001976f7d94 JSC::objCCallbackFunctionCallAsFunction+ 2616724 (OpaqueJSContext const, OpaqueJSValue, OpaqueJSValue, unsigned long, OpaqueJSValue const const, OpaqueJSValue const*) + 236 7 JavaScriptCore 0x00000001976f77b0 long long JSC::APICallbackFunction::callJSC::ObjCCallbackFunction+ 2615216 (JSC::ExecState) + 360 8 JavaScriptCore 0x00000001976d8878 llint_entry + 144488 9 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 10 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 11 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 12 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 13 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 14 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 15 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 16 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 17 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 18 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 19 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 20 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 21 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 22 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 23 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 24 JavaScriptCore 0x00000001976b51c4 vmEntryToJavaScript + 260 25 JavaScriptCore 0x0000000197c4e844 JSC::Interpreter::executeCall+ 8214596 (JSC::ExecState, JSC::JSObject, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 408 26 JavaScriptCore 0x0000000197e5b8a0 JSC::profiledCall+ 10365088 (JSC::ExecState, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtrJSC::Exception&) + 204 27 WebCore 0x0000000190d3b954 WebCore::JSExecState::profiledCall+ 12884308 (JSC::ExecState, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtrJSC::Exception&) + 144 28 WebCore 0x0000000190d53c70 WebCore::JSEventListener::handleEvent+ 12983408 (WebCore::ScriptExecutionContext&, WebCore::Event&) + 1184 29 WebCore 0x0000000190ff6684 WebCore::EventTarget::innerInvokeEventListeners+ 15746692 (WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::DumbPtrTraitsWebCore::RegisteredEventListener >, 1ul, WTF::CrashOnOverflow, 16ul>, WebCore::EventTarget::EventInvokePhase) + 792 30 WebCore 0x0000000190ff3fc4 WebCore::EventTarget::fireEventListeners+ 15736772 (WebCore::Event&, WebCore::EventTarget::EventInvokePhase) + 236 31 WebCore 0x0000000190fef6e0 WebCore::EventContext::handleLocalEvents+ 15718112 (WebCore::Event&, WebCore::EventTarget::EventInvokePhase) const + 236 32 WebCore 0x0000000190ff0968 WebCore::dispatchEventInDOM+ 15722856 (WebCore::Event&, WebCore::EventPath const&) + 232 33 WebCore 0x0000000190ff0558 WebCore::EventDispatcher::dispatchEvent+ 15721816 (WebCore::Node&, WebCore::Event&) + 700 34 WebCore 0x0000000190ff6268 WebCore::EventTarget::dispatchEventForBindings+ 15745640 (WebCore::Event&) + 104 35 WebCore 0x000000019050a72c WebCore::jsEventTargetPrototypeFunctionDispatchEventBody+ 4294444 (JSC::ExecState, WebCore::JSEventTargetWrapper, JSC::ThrowScope&) + 188 36 WebCore 0x0000000190506eac WebCore::jsEventTargetPrototypeFunctionDispatchEvent+ 4279980 (JSC::ExecState) + 232 37 JavaScriptCore 0x00000001976d84ec llint_entry + 143580 38 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 39 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 40 JavaScriptCore 0x00000001976d59bc llint_entry + 132524 41 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 42 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 43 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 44 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 45 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 46 JavaScriptCore 0x00000001976d5908 llint_entry + 132344 47 JavaScriptCore 0x00000001976b51c4 vmEntryToJavaScript + 260 48 JavaScriptCore 0x0000000197c4e844 JSC::Interpreter::executeCall+ 8214596 (JSC::ExecState, JSC::JSObject, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 408 49 JavaScriptCore 0x0000000197e5b8a0 JSC::profiledCall+ 10365088 (JSC::ExecState, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtrJSC::Exception&) + 204 50 WebCore 0x0000000190d3b954 WebCore::JSExecState::profiledCall+ 12884308 (JSC::ExecState, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtrJSC::Exception&) + 144 51 WebCore 0x0000000190d53c70 WebCore::JSEventListener::handleEvent+ 12983408 (WebCore::ScriptExecutionContext&, WebCore::Event&) + 1184 52 WebCore 0x0000000190ff6684 WebCore::EventTarget::innerInvokeEventListeners+ 15746692 (WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::DumbPtrTraitsWebCore::RegisteredEventListener >, 1ul, WTF::CrashOnOverflow, 16ul>, WebCore::EventTarget::EventInvokePhase) + 792 53 WebCore 0x0000000190ff3fc4 WebCore::EventTarget::fireEventListeners+ 15736772 (WebCore::Event&, WebCore::EventTarget::EventInvokePhase) + 236 54 WebCore 0x0000000190ff3ec4 WebCore::WindowEventContext::handleLocalEvents+ 15736516 (WebCore::Event&, WebCore::EventTarget::EventInvokePhase) const + 132 55 WebCore 0x0000000190ff0968 WebCore::dispatchEventInDOM+ 15722856 (WebCore::Event&, WebCore::EventPath const&) + 232 56 WebCore 0x0000000190ff0558 WebCore::EventDispatcher::dispatchEvent+ 15721816 (WebCore::Node&, WebCore::Event&) + 700 57 WebCore 0x0000000190313478 WebCore::EventHandler::dispatchTouchEvent+ 2233464 (WebCore::PlatformTouchEvent const&, WTF::AtomString const&, WTF::HashMap<WebCore::EventTarget, WTF::Vector<WTF::RefPtr<WebCore::Touch, WTF::DumbPtrTraitsWebCore::Touch >, 0ul, WTF::CrashOnOverflow, 16ul>, WTF::PtrHashWebCore::EventTarget, WTF::HashTraitsWebCore::EventTarget, WTF::HashTraits<WTF::Vector<WTF::RefPtr<WebCore::Touch, WTF::DumbPtrTraitsWebCore::Touch >, 0ul, WTF::CrashOnOverflow, 16ul>> > const&, float, float) + 2236 58 WebCore 0x0000000190315960 WebCore::EventHandler::handleTouchEvent+ 2242912 (WebCore::PlatformTouchEvent const&) + 7808 59 WebCore 0x00000001903163f0 WebCore::EventHandler::touchEvent+ 2245616 (WebEvent*) + 132 60 WebKitLegacy 0x0000000194637bf8 -[WebHTMLView touch:] + 72 61 WebCore 0x00000001900f4d28 -[WAKView _selfHandleEvent:] + 172 62 WebCore 0x00000001900f4c54 -[WAKView handleEvent:] + 64 63 WebCore 0x00000001900f4bf4 -[WAKWindow sendEventSynchronously:] + 276 64 UIKitCore 0x000000018ca70618 -[UIWebBrowserView _dispatchWebEvent:] + 88 65 UIKitCore 0x000000018ca70b38 -[UIWebBrowserView _webTouchEventsRecognized:] + 640 66 libobjc.A.dylib 0x00000001881ffaf0 -[NSObject performSelector:withObject:] + 68 67 UIKitCore 0x000000018caaea5c -[UIWebTouchEventsGestureRecognizer performAction] + 72 68 UIKitCore 0x000000018caaec00 -[UIWebTouchEventsGestureRecognizer _processTouches:withEvent:type:] + 396 69 UIKitCore 0x000000018caaf000 -[UIWebTouchEventsGestureRecognizer touchesEnded:withEvent:] + 96 70 UIKitCore 0x000000018c15ecbc -[UIGestureRecognizer _touchesEnded:withEvent:] + 164 71 UIKitCore 0x000000018c5ff540 -[UITouchesEvent _sendEventToGestureRecognizer:] + 580 72 UIKitCore 0x000000018c154d94 __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 84 73 UIKitCore 0x000000018c154eb4 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 224 74 UIKitCore 0x000000018c154d04 -[UIGestureEnvironment _updateForEvent:window:] + 220 75 UIKitCore 0x000000018c5bc960 -[UIWindow sendEvent:] + 3308 76 UIKitCore 0x000000018c598804 -[UIApplication sendEvent:] + 340 77 UIKitCore 0x000000018c612224 dispatchPreprocessedEventFromEventQueue + 5712 78 UIKitCore 0x000000018c6147dc handleEventQueueInternal + 4928 79 UIKitCore 0x000000018c60d960 handleHIDEventFetcherDrain + 112 80 CoreFoundation 0x0000000188465260 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 81 CoreFoundation 0x00000001884651b4 CFRunLoopDoSource0 + 84 82 CoreFoundation 0x0000000188464920 CFRunLoopDoSources0 + 184 83 CoreFoundation 0x000000018845f7ec __CFRunLoopRun + 1068 84 CoreFoundation 0x000000018845f098 CFRunLoopRunSpecific + 480 85 GraphicsServices 0x00000001925c9534 GSEventRunModal + 108 86 UIKitCore 0x000000018c57f7ac UIApplicationMain + 1940 87 EZView 0x0000000102666804 main + 3762180 (main.m:19) 88 libdyld.dylib 0x00000001882def30 start + 4

更多关于uni-app iOS13适配WKWebview必现崩溃问题 PDRCoreApp.m兼容性bug报错(已解决)的实战教程也可以访问 https://www.itying.com/category-93-b0.html


云端打包还是本地离线打包,请提供复现问题的应用示例。

是用iOS开发工具Xcode运行打包的

回复 zzzzzzz_H5: 是提供demo吗还需要其他的资料吗

怎么联系您

回复 DCloud_IOS_XTY: 你这个应该是SDK集成吧,请提供可以复现问题的工程加我QQ

该问题是由于原生层插件书写不规范导致,具体原因如下: 同步方法必须要有返回值 -(void)methodSync:(PGMethod*)args {

}
改为:
-(NSData*)methodSync:(PGMethod*)args {

retrun data;
}

请问怎么解决的

这是iOS13下WKWebView与uni-app内核PDRCore的兼容性问题。主要原因是WKWebView的JavaScript prompt回调处理存在线程安全问题,导致objc_msgSend崩溃。

解决方案:

  1. 更新HBuilderX到最新版本(2.7.14+),官方已修复此问题
  2. 临时解决方案是在manifest.json中配置:
"ios": {
    "WKWebview": false
}
回到顶部