I encountered a problem when adding a new custom font in Xcode 16.1. After including the font and opening my XIB files, the interface preview became blank and the application seemed to experience a heavy load.
To troubleshoot, I removed all custom fonts, and everything returned to normal functionality. However, even after reinstalling Xcode, the issue persisted when adding the font again.
The XIB preview loaded correctly:
The XIB preview turned blank and became unresponsive:
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
everything works fine in Xcode15, but in Xcode16 it break down.
when I add breakpoint, I start po variable , the lldb shows
error: type for self cannot be reconstructed: type for typename "$s8XYRouter8RegistryOXMtD" was not found (cached)
error: Couldn't realize Swift AST type of self. Hint: using `v` to directly inspect variables and fields may still work.
how can I fix the issues!!!. it really mattttttes, and it cause cant developing as normally.
pls, save the child.
I am trying to update the EditButton after deleting rows in a List, but its title doesn't change. I have sent an update event via a publisher that applies the mode change based on the number of items remaining in the list. Here's the update event handler:
.onReceive(updateViewPublisher, perform: { _ in
self.editMode?.wrappedValue = textFileData.textFiles.count == 0 ? .inactive : .active
update += 1
})```
The edit mode is changed to inactive when the list is empty, but the button continues to display 'done'. If I adda new list item it remains set to 'done' and the delete control is displayed against the new item.
I have seen loads of posts about this on various sites, but no solutions. I am trying this on Xcode 16.2 and IOS 18.2. If someone from Apple sees this, a reply would be most welcome.
I would like a shortcut for deleting view in swiftui
VStack {
// long code
}
How to delete VStack with its ending curly bracket?
Thanks
there are other unresolved posts on this issue but maybe mine is solvable.
I copied the files I contributed from a working project to a new project using the finder (drag and drop). So I did not copy entitlements. Xcode automatically added the files to the project just fine. My app uses data on a removable drive, or used to, because I now get the error above. At one point I copied the product app to the desktop hoping to get the permissions alert window, but it never came. Oddly, in System Settings/Privacy & Security/Files & Folders my "new" app is listed with "Removable Volumes" slider = on.
The file permissions (unix-like) on that drive haven't changed between projects and allow everyone to read.
How can I fix this?
I'm trying to compile my iPad app with Xcode 16.2 and I'm consistently getting this error message:
couldn't find compile unit for the macro table with offset = 0x0
This is happening at the GenerateDSymFile step. I've tried changing the debug format from Dwarf with Dsym to Dwarf and then back again, as I've read there was a problem with generating the dsyms. But the problem persists.
I've tried searching for this error and found nothing online, so apparently I'm the only one! How strange.
Are there any settings or flags I can change to try to get more information about what's going wrong?
Topic:
Developer Tools & Services
SubTopic:
Xcode
In the Xcode 16.2 release notes, it says to avoid a memory leak in Swift 6 you should "Pass -checked-async-objc-bridging=off to the Swift compiler using “Other Swift Flags” in Xcode build settings." https://developer.apple.com/documentation/xcode-release-notes/xcode-16_2-release-notes#Swift
However, when I add this value to OTHER_SWIFT_FLAGS (either in the Xcode build settings interface, or in an .xcconfig file), it yields a build error:
error: Driver threw unknown argument: '-checked-async-objc-bridging' without emitting errors.
Does anybody know if there's a trick to get this working that isn't explained in the release notes?
Hello,
I am encountering "unable to open dependencies file" error in XCode that started after updating to Xcode version 16.2 and macOS version 15.2. The error message I receive is as follows:
error: unable to open dependencies file (/Users/user/Library/Developer/Xcode/DerivedData/MyProject-cwpcmnebzjpgkzcuoauxlaeiqrsg/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/arm64/MyProject-master.d) (in target 'MyProject' from project 'MyProject')
This problem didn’t occur with XCode 16.1; the project was building successfully before the update.
Now, even reverting to XCode 16.1 doesn’t resolve the issue anymore.
Here’s what I’ve tried so far without success:
Switched the compilation mode to “Whole Module”
Cleaned the build folder
Cleared Derived Data
Thank you in advance for any suggestions!
Topic:
Developer Tools & Services
SubTopic:
Xcode
class ViewModel : NSObject, ObservableObject, ASWebAuthenticationPresentationContextProviding {
private var authSession: ASWebAuthenticationSession?
func signInWithOpenID(provider: OAuthProvider) {
let url = getOIDCAuthenticationURL(provider: provider)
authSession?.cancel()
authSession = nil
authSession = ASWebAuthenticationSession(url: url, callbackURLScheme: "com.ninjanutri") { callbackURL, error in
if let error = error {
print("Error: \(error.localizedDescription)")
return
}
guard let callbackURL = callbackURL else { return }
guard let idToken = callbackURL.valueOf("id_token") else { return }
self.signInWithIdToken(provider: provider, idToken: idToken)
}
authSession?.prefersEphemeralWebBrowserSession = false
authSession?.presentationContextProvider = self
authSession?.start()
}
public func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
return ASPresentationAnchor()
}
}
struct ContentView: View {
@StateObject private var viewModel = ViewModel()
var body: some View {
Button {
viewModel.signInWithOpenID(provider: .github)
} label: {
Text("Test")
}
}
}
when the prefersEphemeralWebBrowserSession is false, the alert and webview is totally working fine in Simulator and Real device, but not XCode Preview. Is this behaviour expected or it's a bug?
Am running Xcode 16.1 on Sequoia and am getting "No such module" error.
Here are my steps:
Create workspace in Xcode and name it AccessControl2
Create Project named OrangeInc and add it to AccessControl2 group.
Create blank playground named AccessControl and add it to AccessControl2 group
Error message in playground after I add "import OrangeInc" reads "No such module"
Have tried repeating this several times; get same error message.
struct viewdetail: View {
@State var text1:String = ""
@State var tip1:String = ""
@State var text23:String = ""
@State var tip23:String = ""
var body: some View {
Text(text1);Text(tip1);Text(text23);Text(tip23)
} }
func detailline(costa:inout [Double],tipa:inout [Double]) {
print(costa,tipa)
text1 = "125" Cannot find 'text1' in scope print("detail")
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
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.
Why is Apple not releasing Swift Assist?
Can someone from Apple officially confirm either a delay or cancellation of this feature? 9 days before 2024 ends and Apple said “later this year” in June 2024. Apple mentioned Swift Assist even in the MacBook Pro announcement on the 30th of October 2024 as if it already exists.
Hi,
I want to run the live preview on my iPhone, but I received the error message that the app failed to launch.
How can I fix this? Everything is made with SwiftUI
Thanks
I'm trying to transfer a CSV file to my iPhone 16 simulator to use for testing my application, but it keeps failing. See the image below.
That occurs when I try to drag the file into the simulator. I also tried to use the Share option for the file, but nothing happens with that. It doesn't transfer but it also doesn't fail. I'm assuming it's failing in the background.
Anyone know what I can do?
I built my app with Xcode16 and now the app is crashing.
I suspect that the dynamic actor isolation check is the cause, so I'm trying to set the "-disable-dynamic-actor-isolation" flag, but the app crashes, so I don't think I'm setting it correctly.
How to set "-disable-dynamic-actor-isolation" flag?
Swift Complier - Custom Flags
Other Swift Flags
Debug
Any Architecture | Any SDK -disable-dynamic-actor-isolation
Release
Any Architecture | Any SDK -disable-dynamic-actor-isolation
I have it set up as shown above.
Topic:
Developer Tools & Services
SubTopic:
Xcode
在使用 Xcode 构建项目时,我遇到了以下错误:
Showing All Errors Only
Prepare packages
Prepare build
Build service could not create build operation: unable to load transferred PIF: The workspace contains multiple references with the same GUID 'PACKAGE:1Y9CU7L2QFO7OX4UJBYP19ZPPL5MJNV3R::MAINGROUP'
Activity Log Complete 2024/12/24, 15:26 0.2 seconds
问题描述:
1. 我正在开发一个使用 Swift Package Manager (SPM) 管理依赖的多模块 iOS 项目。
2. 构建过程中,Xcode 无法加载传输的 PIF 文件,并提示某个 GUID 存在重复引用。
3. 这个问题导致整个项目无法正常构建。
已尝试的解决方案:
1. 检查了 Swift Package Manager 的依赖管理:
• 确认没有重复添加相同的依赖。
2. 清理了 Derived Data:
3. 检查了 project.pbxproj 文件,搜索 GUID 'PACKAGE:1Y9CU7L2QFO7OX4UJBYP19ZPPL5MJNV3R::MAINGROUP':
• 没有发现明显的重复引用。
4. 删除并重新添加了所有的 Swift 包依赖。
5. 删除并重新生成了 .xcworkspace 文件。
结果:
• 尝试以上解决方案后问题依然存在,构建仍然失败。
• 这可能是由于某些依赖的重复引用或 Xcode 内部的问题。
Xcode 16.2
Mac OS 15.2
如果有人遇到过类似问题或者知道该如何解决,能否分享一下解决方案?
非常感谢!
When I built my app with xCode16.2, the app crashed at runtime.
When building, I got a warning "UIWebView' is deprecated: first deprecated in iOS 12.0 - No longer supported; please adopt WKWebView.", so I suspected the dynamic actor isolation check.
When building, I tried setting the "-disable-dynamic-actor-isolation" flag, but the app still crashed.
However, I think the flag is not set properly, so how should I set the "-disable-dynamic-actor-isolation" flag?
I tried setting it as follows. Is this the correct way to set it?
Swift Compiler - Custom Flags
Other Swift Flags
Debug
Any Architecuture | Any SDK -disable-dynamic-actor-isolation
Release
Any Architecuture | Any SDK -disable-dynamic-actor-isolation
Topic:
Developer Tools & Services
SubTopic:
Xcode
I have downloaded xcode version 14.2 from apple official archive. I ran xcode using these steps:
Right click -> Show Package content
Go to folder Contents -> Macos -> Xcode
Run the xcode terminal app
After this as soon as I try to open a project, xcode crashes. How do i run xcode of lower version as that specific version is required, I don't want to downgrade my macos as it will result in clearing my data or I have to transfer data.
Please help me with this issue.