-[UIThreadSafeNode canPerformAction : withSender :] : 인식 할 수없는 선택기가 인스턴스로 전송되었습니다.


9

iOS 앱 에서이 충돌에 직면하고 있습니다.

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1b9079c30 __exceptionPreprocess
1  libobjc.A.dylib                0x1b8d940c8 objc_exception_throw
2  CoreFoundation                 0x1b8f77fc0 -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x1b907e3d4 ___forwarding___
4  CoreFoundation                 0x1b9080570 _CF_forwarding_prep_0
5  UIKitCore                      0x1bcf33444 -[UIKeyboardImpl deleteForwardAndNotify:]
6  UIKitCore                      0x1bcf39154 __57-[UIKeyboardImpl acceptPredictiveInput:executionContext:]_block_invoke
7  UIKitCore                      0x1bcf5b0c8 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
8  UIKitCore                      0x1bcf366ec __100-[UIKeyboardImpl addWordTerminator:afterSpace:afterAcceptingCandidate:elapsedTime:executionContext:]_block_invoke
9  UIKitCore                      0x1bcf5b0c8 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:]
10 UIKitCore                      0x1bcf2bdc0 __55-[UIKeyboardImpl handleKeyboardInput:executionContext:]_block_invoke_2
11 UIKitCore                      0x1bcf5cd70 -[UIKeyboardTaskEntry execute:]
12 UIKitCore                      0x1bcf5b6d4 -[UIKeyboardTaskQueue continueExecutionOnMainThread]
13 libobjc.A.dylib                0x1b8d8faf0 -[NSObject performSelector:withObject:]
14 Foundation                     0x1b946ec10 __NSThreadPerformPerform
15 CoreFoundation                 0x1b8ff5260 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
16 CoreFoundation                 0x1b8ff51b4 __CFRunLoopDoSource0
17 CoreFoundation                 0x1b8ff4920 __CFRunLoopDoSources0
18 CoreFoundation                 0x1b8fef7ec __CFRunLoopRun
19 CoreFoundation                 0x1b8fef098 CFRunLoopRunSpecific
20 GraphicsServices               0x1c3159534 GSEventRunModal
21 UIKitCore                      0x1bd10f7ac UIApplicationMain
22 Haraj                          0x102fc6058 main + 15 (main.m:15)
23 libdyld.dylib                  0x1b8e6ef30 <redacted>

지금까지 100 건 이상의 충돌이보고되었습니다. 이것은 iOS 12 및 iOS 13에서만 발생합니다.

어떻게 이런 일이 일어나고 어떻게 재현하는지 알 수 없습니다.

스택 추적에 내 앱 코드가 표시되지 않습니다.

여기에 전체 충돌 보고서를 업로드했습니다 .

도움을 주시면 감사하겠습니다.

답변:


10

이것은 iOS 텍스트 항목의 "앞으로 삭제"와 관련된 고대 버그의 회귀 인 것 같습니다 : http://www.openradar.me/15114422

새로운 "스 와이프하여 입력"키보드 때문에 회귀했다고 생각합니다.

수정하는 두 가지 옵션이 있습니다.

  1. 더 이상 사용되지 않는 UIWebView를 WKWebView로 업그레이드
  2. 해키 솔루션 : UIThreadSafeNode런타임 에 누락 된 선택기를 삽입하십시오 .

누락 된 선택기를 삽입하는 방법에 대한 코드 예제는 다음과 같습니다.

BOOL canPerformAction(id withSender) {
    return false;
} 

- (void)viewDidLoad {
   [super viewDidLoad];

   Class class = NSClassFromString(@"UIThreadSafeNode");
   class_addMethod(class, @selector(canPerformAction:withSender:), (IMP)canPerformAction, "@@:");
}

AppDelegate와 같이 메소드 삽입은 한 번만로드되는 위치에 두어야합니다.

필요한 경우 전체 예제 프로젝트는 다음과 같습니다. https://github.com/elliotfiske/UIWebView-TextEntry-CrashFix/tree/master

재현하는 방법 :

UIWebView에서 텍스트 입력 양식을 작성하고 단어를 입력 한 다음 문장 가운데 단어의 정확한 끝으로 커서를 이동하십시오.

그런 다음 예측 가능한 텍스트 제안을 선택하십시오. 작동중인 버그 확인 :충돌 재생 화면 녹화


2
WKWebView를 사용하고 있습니다. 해킹 솔루션이 마음에 듭니다. 나는 그것이 작동하기를 바랍니다! :)
Abdullah Umer

나는 iOS13.2.2 개발자 베타에있는 UIWebView에 충돌 repro 수 할 수 아니에요
harshith7823
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.