New JRE input stream reader issues on iOS 17

113 views
Skip to first unread message

Colin

unread,
Jun 26, 2023, 10:49:25 AM6/26/23
to j2objc-discuss
Hello!

I recently began testing our app under iOS 17 and Xcode 15 betas to check for any issues that might need our attention before their official release by Apple later this year. While testing, I was able to find a new regression - after fetching data from the network our app is unable to parse the JSON responses - and I've been able to narrow it down to a minimal test case that shows a change in behavior between iOS 16 and iOS 17 for the JRE emulation code. It looks like JavaIoInputStreamReader is closing early and thus isn't properly able to read a stream.

I've linked a snippet of code here to demonstrate: https://gist.github.com/cfdrake/134f996aaa308e04a265b844834210dd

On iOS 16 I see that the reader indicates it is ready, the stream has 10 characters available to read, and the loop executes printing each character out line by line.

With no changes, on iOS 17 beta I see that the reader indicates it is ready, the first byte is read, but the loop only executes once, printing 65533 and exiting.

Due to this issue our app is unable to read and parse JSON data on iOS 17. Please let me know if anyone else is able to replicate this issue.

Thank you for your time,
Colin

Colin

unread,
Jun 29, 2023, 1:14:50 PM6/29/23
to j2objc-discuss
Hi all, just wanted to check in on this iOS 17 issue and see if anyone else is able to replicate it or might know what's going on?

I've attached a runnable Xcode test project to this message demonstrating the error using the snippet above. Running under iOS 17/16 should produce differing outputs (see ViewController.swift for the logic). To run the project, you'll just need to update J2OBJC_HOME in Build Settings to point to your local install.

Thanks again,
Colin
j2objc-ios-17-test.zip

Colin

unread,
Jun 29, 2023, 1:31:27 PM6/29/23
to j2objc-discuss
First of all, I apologize for this double-post! But I just noticed I accidentally included a missing file in the bridging header above that shouldn't be there.

1) I've attached a new test project to this message fixing the issue.

2) I started wondering if writing to a stream is also failing on iOS 17 as I was seeing a missing JSON body in our HTTP requests. It appears writing to a stream is also ending early on iOS 17! I've added another test case demonstrating this to the test project.

-Colin
j2objc-ios-17-test-v2.zip
Reply all
Reply to author
Forward
0 new messages