Closed msasikanth closed 5 months ago
@msasikanth It seems that the NumberFormatException is caused by the toDouble
method in the following code added in version 1.9.6. However, it is strange to have a NumberFormatException here, since scrollOffset
is just a map of Int.
webView.scrollView.setContentOffset(
CGPointMake(
x = state.scrollOffset.first.toDouble(),
y = state.scrollOffset.second.toDouble(),
),
true,
)
I am unable to reproduce this exception on my end. Does your web page contain any operations on the scroll position? Could you try testing this on a simple HTML page?
I tried it with my website link: https://sasikanth.dev/dev-log-3/, but it's failing. I am not doing anything fancy with that š¤
@msasikanth what's the version of your ios device? Is the exception still the NumberFormatException for website link? It still works well on my device(ip15PM 17.4).
@msasikanth what's the version of your ios device? Is the exception still the NumberFormatException for website link? It still works well on my device(ip15PM 17.4).
Yep, I tried it on iPhone 15 Pro (17.4.1). All the issue reports from my project are also from this version across different models.
The project I am having issues with is open source in case you want a project to reproduce the issue. https://github.com/msasikanth/twine
If I revert the 1.9.6 update, everything is working fine FWIW.
@msasikanth Thanks for the information! So, both the URL and HTML are not functioning properly in version 1.9.6 of your project?
Yes. I tested with a sample URL, but I primarily load HTML strings in my project and so far I only received this issue on device versions 17.4.1
@msasikanth That's weird, considering that the code responsible for causing this issue should not have been executed for version 15 or higher. Its purpose is to restore the scroll position for iOS devices running version 15 or lower, which do not support interactionState. Do you happen to have the stacktrace for the 17.4.1 device?
Yeah, it's the same as what I posted. Here is what I received from crash reporting
CrashReporter Key:
Hardware Model: iPhone15,2
Process: Twine
Identifier: dev.sasikanth.rss.reader
Version: 1.40.0
Role: Foreground
OS Version: iOS 17.4.1
kotlin.NumberFormatException:
0 Twine +0x203a4 kfun:kotlin.native.internal.FloatingPointParser.initialParse#internal (FloatingPointParser.kt)
1 Twine +0x1ef40 <inlined-out:parse> (FloatingPointParser.kt:134:20)
2 Twine +0xd76944 _636f6d706f73652d776562766965772d6d756c7469706c6174666f726d3a776562766965772f55736572732f6b6576696e7a6f752f50726f6a6563742f434d4d2f636f6d706f73652d776562766965772d6d756c7469706c6174666f726d2f776562766965772f7372632f696f734d61696e2f6b6f746c696e2f636f6d2f6d756c7469706c6174666f726d2f776562766965772f7765622f574b4e617669676174696f6e44656c65676174652e6b74_kncfun38
3 WebKit +0x55ae64 WebKit::NavigationState::NavigationClient::didFinishNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*)
4 WebKit +0x7284dc WebKit::WebPageProxy::didFinishLoadForFrame(WebCore::ProcessQualified<WTF::ObjectIdentifierGeneric<WebCore::FrameIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits> >, WebKit::FrameInfoData&&, WebCore::ResourceRequest&&, unsigned long long, WebKit::UserData const&)
5 WebKit +0xbd6fe8 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
6 WebKit +0xced964 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
7 WebKit +0x796168 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
8 WebKit +0xce89cc IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
9 WebKit +0xce8e54 IPC::Connection::dispatchIncomingMessages()
10 JavaScriptCore +0x58d40 WTF::RunLoop::performWork()
11 JavaScriptCore +0x59c68 WTF::RunLoop::performWork(void*)
12 CoreFoundation +0x37628 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
13 CoreFoundation +0x368a4 ___CFRunLoopDoSource0
14 CoreFoundation +0x35054 ___CFRunLoopDoSources0
15 CoreFoundation +0x33d84 ___CFRunLoopRun
16 CoreFoundation +0x33964 _CFRunLoopRunSpecific
17 GraphicsServices +0x34dc _GSEventRunModal
18 UIKitCore +0x22aed8 -[UIApplication _run]
19 UIKitCore +0x22a514 _UIApplicationMain
20 SwiftUI +0x103385c 0x18d03f85c (0x18d03f7b8 + 164)
21 SwiftUI +0x10336a4 0x18d03f6a4 (0x18d03f610 + 148)
22 SwiftUI +0xc4f9f8 0x18cc5b9f8 (0x18cc5b978 + 128)
23 Twine +0x85a0 static iOSApp.$main() (iOSApp.swift)
24 dyld +0x5d80 start
The stack trace I posted in the issue description is from the XCode stack trace on the debug build.
@msasikanth It should be fixed in 1.9.7. Please let me know if you encounter any further issues. Thanks again!
It's resolved now. Thanks šš¾
Hi, I updated to the latest version 1.9.6 and the webview has suddenly started to crash on iOS
My current setup looks like this