Closed
Description
Environment
- Xcode version: 11.2
- Firebase SDK version: 6.12.0
- Firebase Component: DynamicDeeplinks
- Component version: 4.0.5
Problem
We are in the process of creating a shared framework that contains Firebase. When the framework is imported on the new app, the application crashes right away while trying to retrieve pending deeplinks.
Steps to reproduce:
- Create a shared framework with firebase in it.
- Import it in a new project and
configure
firestore on th app delegate. - The main application will crash.
There aren't any custom domains on the Info.plist.
Relevant Code:
Snippet from FIRDLJavaScriptExecutor.m
#pragma mark - WKNavigationDelegate - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation { __weak __typeof__(self) weakSelf = self; // Make sure that the javascript was loaded successfully before calling the method. [webView evaluateJavaScript:FIRDLTypeofFingerprintJSMethodNameString() completionHandler:^(id _Nullable typeofResult, NSError *_Nullable typeError) { if (typeError) { [weakSelf handleExecutionError:typeError]; return; } if ([typeofResult isEqual:@"function"]) { [webView evaluateJavaScript:GINFingerprintJSMethodString() completionHandler:^(id _Nullable result, NSError *_Nullable functionError) { if ([result isKindOfClass:[NSStringclass]]) { [weakSelf handleExecutionResult:result]; // ^^^^^^^^ CRASH due to weakSelf being deallocated. } else { [weakSelf handleExecutionError:nil]; } }]; } else { [weakSelf handleExecutionError:nil]; } }]; }
Stacktrace
(lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x54892ed86e80) frame #0: 0x00007fff50bad00b libobjc.A.dylib`objc_release + 11 * frame #1: 0x0000000109d5757f PSI`__55-[FIRDLJavaScriptExecutor webView:didFinishNavigation:]_block_invoke_2(.block_descriptor=0x0000600002839170, result=@"en-US", functionError=0x0000000000000000) at FIRDLJavaScriptExecutor.m:117:26 frame #2: 0x00007fff2d0dec4d WebKit`WTF::Detail::CallableWrapper<-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]::$_7, void, API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&, WebKit::CallbackBase::Error>::call(API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&, WebKit::CallbackBase::Error) + 363 frame #3: 0x00007fff2d173647 WebKit`WebKit::GenericCallback<API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&>::performCallbackWithReturnValue(API::SerializedScriptValue*, bool, WebCore::ExceptionDetails const&) + 41 frame #4: 0x00007fff2d173502 WebKit`WebKit::WebPageProxy::scriptValueCallback(IPC::DataReference const&, bool, WebCore::ExceptionDetails const&, WebKit::CallbackID) + 296 frame #5: 0x00007fff2d3d43b4 WebKit`void IPC::handleMessage<Messages::WebPageProxy::ScriptValueCallback, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(IPC::DataReference const&, bool, WebCore::ExceptionDetails const&, WebKit::CallbackID)>(IPC::Decoder&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(IPC::DataReference const&, bool, WebCore::ExceptionDetails const&, WebKit::CallbackID)) + 100 frame #6: 0x00007fff2cf5964e WebKit`IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 114 frame #7: 0x00007fff2d1a3ea8 WebKit`WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 24 frame #8: 0x00007fff2cf44cf2 WebKit`IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 158 frame #9: 0x00007fff2cf47a44 WebKit`IPC::Connection::dispatchIncomingMessages() + 408 frame #10: 0x00007fff26881d74 JavaScriptCore`WTF::RunLoop::performWork() + 228 frame #11: 0x00007fff26882002 JavaScriptCore`WTF::RunLoop::performWork(void*) + 34 frame #12: 0x00007fff23bb2221 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 frame #13: 0x00007fff23bb214c CoreFoundation`__CFRunLoopDoSource0 + 76 frame #14: 0x00007fff23bb1924 CoreFoundation`__CFRunLoopDoSources0 + 180 frame #15: 0x00007fff23bac62f CoreFoundation`__CFRunLoopRun + 1263 frame #16: 0x00007fff23babe16 CoreFoundation`CFRunLoopRunSpecific + 438 frame #17: 0x00007fff38438bb0 GraphicsServices`GSEventRunModal + 65 frame #18: 0x00007fff4784fb68 UIKitCore`UIApplicationMain + 1621 frame #19: 0x00000001067a6ce5 mindfulness`main(argc=1, argv=0x00007ffee945cce8) at main.m:20:20 frame #20: 0x00007fff51a1dc25 libdyld.dylib`start + 1 frame #21: 0x00007fff51a1dc25 libdyld.dylib`start + 1 (lldb)
NOTES
We've been able to workaround the issue by adding FirebaseDeepLinkAutomaticRetrievalEnabled
to Info.plist
Related: #3945
Thanks !