When I go to the App Settings menu in Swift Playgrounds and attempt to upload to App Store Connect, I run into the below error screen:
I am registered with the Apple Developer Program.
Swift Playgrounds is updated to its latest version.
This is occurring on both macOS and iPadOS.
All the information I put in is valid.
Any reason why this would be happening?
Post
Replies
Boosts
Views
Activity
I’m working on an Xcode App Playground project (.swiftpm) and trying to add a .mlmodel file (e.g., Exercises.mlmodel) to it. However, when I add the .mlmodel file to my project, I encounter the following error:
Exercises.mlmodel: No predominant language detected. Set COREML_CODEGEN_LANGUAGE to preferred language.
The .mlmodel file works perfectly fine when used in a regular Xcode project (.xcodeproj), but this issue occurs as soon as I add the file in an App Playground project (.swiftpm).
Steps I’ve Tried:
Ensuring the .mlmodel file is correctly added to the project folder.
Checking the generated Core ML Swift code in a .xcodeproj environment—works as expected.
Searching for a way to explicitly set COREML_CODEGEN_LANGUAGE in a .swiftpm project, but it seems that Xcode does not provide this option.
Any advice or solutions would be greatly appreciated!
I have tried the solutions in these articles, however none of them worked:
https://medium.com/@sofiadinizms/how-to-use-coreml-in-swift-playgrounds-8d5f001c5d15
https://developer.apple.com/forums/thread/743942?answerId=776359022#776359022
I’m trying to use the Vision framework in a Swift Playground to perform face detection on an image. The following code works perfectly when I run it in a regular Xcode project, but in an App Playground, I get the error:
Thread 12: EXC_BREAKPOINT (code=1, subcode=0x10321c2a8)
Here's the code:
import SwiftUI
import Vision
struct ContentView: View {
var body: some View {
VStack {
Text("Face Detection")
.font(.largeTitle)
.padding()
Image("me")
.resizable()
.aspectRatio(contentMode: .fit)
.onAppear {
detectFace()
}
}
}
func detectFace() {
guard let cgImage = UIImage(named: "me")?.cgImage else { return }
let request = VNDetectFaceRectanglesRequest { request, error in
if let results = request.results as? [VNFaceObservation] {
print("Detected \(results.count) face(s).")
for face in results {
print("Bounding Box: \(face.boundingBox)")
}
} else {
print("No faces detected.")
}
}
let handler = VNImageRequestHandler(cgImage: cgImage, options: [:])
do {
try handler.perform([request]) // This line causes the error.
} catch {
print("Failed to perform Vision request: \(error)")
}
}
}
The error occurs on this line:
try handler.perform([request])
Details:
This code runs fine in a normal Xcode project (.xcodeproj).
I'm using an App Playground instead (.swiftpm).
The image is being included in the .xcassets folder.
Is there any way I can mitigate this issue? Please do not recommend switching to .xcodeproj, as I am making a submission for Apple's Swift Student Challenge, and they require that I use .swiftpm.