String.init(_cocoaString:) crash on iOS 17 Beta

Recently, we are testing our app on iOS 17, and found a weird crash that occurred on iOS 17, not on iOS 16 and below.

Here's the stack:

the sha512 is a function we wrote for the String extension:

public extension String {
  var sha512: String? {
    return self.data(using: .utf8).map { NSData(data: $0).sha512() }
  }
}

We cannot find any mistake from the code above, and the code works well on iOS 16 and below (packaged by Xcode 14.2). And it also works on:

  1. iOS 17 simulator running from Xcode 14.2.
  2. iOS 17 simulator running from Xcode 15 Beta 4.
  3. iOS 17 beta 3/4 real device running from Xcode 15 Beta 4 (debug).

It doesn't works on:

  1. packaged by Xcode 14.2 and running on iOS 17 beta real device.

not tested:

  1. packaged by Xcode 15 Beta and running on iOS 17 beta real device.

Is that an iOS 17 bug? Or anyone may know how to fix that? I will very appreciate your advice, thank you.

Answered by fs7 in 761312022

As iOS 17 Beta 5 is just released, we have a good news. The crash has been disappeared on the newest os. Thus, the problem seems to be fixed

We've just tested on:

packaged by Xcode 15 Beta and running on iOS 17 beta real device.

It works.

So, I think there's a compatible problem for iOS 17 Beta? We haven't ready to migrate to Xcode 17, hope this will be fixed in later iOS 17 beta versions.

I also encountered this problem, but haven't found a specific solution

Accepted Answer

As iOS 17 Beta 5 is just released, we have a good news. The crash has been disappeared on the newest os. Thus, the problem seems to be fixed

String.init(_cocoaString:) crash on iOS 17 Beta
 
 
Q