Comments (5)
Hello!
I've been probing more into this recently and think I have found the root issue.
Here is a minimal test case that will work on iOS 16 and fail on iOS 17 beta, calling into j2objc's JRE emulation:
func testDecodeStream() {
let testString = "{testtest}"
let data = testString.data(using: .utf8)
let byteArray = IOSByteArray(nsData: data)
let stream: JavaIoInputStream = JavaIoByteArrayInputStream(byteArray: byteArray)
let reader: JavaIoReader = JavaIoInputStreamReader(javaIoInputStream: stream, with: "UTF-8")
print("ready? \(reader.ready())")
while (reader.ready()) {
let byte = reader.read()
print(byte)
print("--")
}
}
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
.
Based on what I've been reading, GSON is using these functions/classes internally for parsing JSON responses, which is why we're seeing the failures in our app.
from j2objc.
Just a note I've found that writing to a stream fails on iOS 17 as well. See the test code here:
private func testWriteSteam() {
let stream = JavaIoByteArrayOutputStream()
let writer = JavaIoBufferedWriter(javaIoWriter: JavaIoOutputStreamWriter(javaIoOutputStream: stream, with: "UTF-8"))
let testString = "{testtest}"
let byteArray = IOSCharArray(nsString: testString)!
writer.write(with: byteArray, with: 0, with: byteArray.length())
writer.flush()
print(stream)
print("DONE!")
}
On iOS 16 I see "{testtest}" and on iOS 17 it just prints an empty line.
from j2objc.
Hi Cotlin, I apologize for my late reply. Your finding looks real, and thanks for your report and test cases!
The team is sort of under-staffed at the moment, so the response might be a bit slow. But this one is indeed import to us, and we'll look into it.
Thanks again. :)
from j2objc.
@litstrong Great, thanks for confirming.
Just a note I've done some further testing on this and interestingly it only appears to be an issue with the simulator, not physical devices running the beta.
from j2objc.
Hi Cotlin,
I tested your code snippet under Xcode 15 beta 8 (simulator), and it seems running well.
from j2objc.
Related Issues (20)
- Unable to build J2ObjC with Java 1.8 HOT 2
- Add info about which signing keys will be used for published artifacts. HOT 1
- Is this convert JAVA 11 code? HOT 3
- a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] HOT 7
- Facing permission denide issue while converting java code to objective C HOT 1
- The 'build_subset_frameworks.sh' script fails
- CI Workflow Runs are failing HOT 1
- Cannot use JRE.xcframework with Xcode 15 Release Candidate due to code signing issue HOT 13
- JRE_Core.xcframework is missing headers HOT 2
- make dist fails make: *** [jre_emul_jars_dist] Error 2 HOT 9
- Headers information is missing from the XCFrameworks' "Info.plist" files HOT 6
- Encountering "multiple commands produce 'module.modulemap'" error when linking a target with any two of the J2ObjC XCFrameworks HOT 1
- When can you update the new version? HOT 3
- JAVA code is configured with JVM, how do I configure JVM into J2OBJC? HOT 1
- My
- Myself
- Files with same name HOT 3
- Size of JRE.xcframework exceeds 75MB limit of appstoreconnect HOT 2
- bitwise error ( sudo make dist command ). JDK 15 osx Sonoma 14.1.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from j2objc.