I'm quite new to Xcode development, and I've been having an issue test-running my app. When I run the app on my iPhone from my Mac, the app launches properly and works initially. However, when I close the app fully and try to reopen it, it keeps crashing. This occurs whether I test on a physical device or an iPhone simulator.
Somehow, this issue does not occur when the app is run on Profile mode.
I would appreciate any pointers to debug this.
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
I just noticed this today while building a React Native app.
Anybody else seen this and know what it means/how to track it down/how to fix it
I'm trying to debug on my iPhone 16e and I'm running into this error:
Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.)
Since all of my other devices are working fine, I assume this is due to outdated XCode, which is something I see mentioned in other threads.
What is the specific XCode version needed to build onto the 16e and is there any workaround for XCode 16.1?
Thanks!
I've used SPM to install some dependencies, however for one of them, CocoaLumberjackSwift the Embed section is blank and attempting to click in it doesn't brink up any dropdown menuetc.
Why is that, how can I change it or check what its set to if its blank?
(Code 16.2)
When I try to submit to TestFlight, I'm told:
"Unsupported SDK or Xcode version ... You need to use the latest Release Candidates for SDKs and Xcode."
I am using the latest Xcode RC, Version 16.3 (16E137). But my guess is that I am not being given, in conjunction with this, the latest iOS 18.4 RC. I need 22E239 but I'm unable to download and install it thru Xcode. What I'm being given is SDK version 18.4 (22E235).
Topic:
Developer Tools & Services
SubTopic:
Xcode
I want to build an ios .xcframework (for external delivery) and .framework(for internal debugging) in order to package some code to a customer for incorporation into their app.
My framework has a dependency upon RealmSwift, which I've added using SPM.
There is a warning saying
Module RealmSwift was not compiled with library evolution support.
And when building SwiftVerifyEmittedModuleInterface fails with an error saying
"missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'"
By default, Build Libraries For Distribution was set to YES, however if I turn it off then the warning and error go away and I can cleanly build the framework.
I've been attempting to get a good understanding of this flag and if it should be used or not, most material says yes but doesn't go a good job of explaining why.
However anyway I can't get the framework to build with RealmSwift as a dependency without turning off this flag. Therefore is that ok to proceed down that route?
Does the fact the xcframework will only ever be distributed to one consumer affect decisions (i.e. binary compatibility etc.)
Thanks
It is not working properly. What should I do?
We enabled ARKit replay data and chose a .mov file from reality composer. However, the app does not launch after build and run in Xcode. It stays stuck saying "Attaching to app on iPad".
Does anyone have this problem?
System Information:
macOS Version 14.6.1 (Build 23G93)
Here's what my Info.plist looks like:
The problem here is that there is no value column. No where for me to edit the values. It's driving me insane. I can edit in a vanilla text editor, but it's annoying to use the auto complete feature here and then open a text editor to change the value.
Anyone know why this could be happening? Am I just missing a setting toggle somewhere?
I attempted to create a SortDescriptor using a method in enum to sort various different models in SwiftUI lists.
But it causes crashes in Xcodes previews but not in the simulator, and I don't know why.
Maybe someone could suggest changes.
extension Item:ListSorting {} //List sorting is a protocol given to various Models
enum ListSortingStyle<T>:String,CaseIterable where T:ListSorting {
case alphabetical = "A…Z"
case alphabeticalReverse = "Z…A"
case createDate = "Newest"
case createDateReverse = "Oldest"
case editDate = "Latest Edit"
case editDateReverse = "Oldest Edit"
/// Returns a SortDescriptor matching the enumeration
func sortDescriptor() -> SortDescriptor<T> {
switch self {
case .alphabetical:
SortDescriptor<T>(\.name, comparator: .localized, order: .forward)
case .alphabeticalReverse:
SortDescriptor<T>(\.name, comparator: .localized, order: .reverse)
case .createDate:
SortDescriptor<T>(\.creationDate, order: .forward)
case .createDateReverse:
SortDescriptor<T>(\.creationDate, order: .reverse)
case .editDate:
SortDescriptor<T>(\.editDate, order: .forward)
case .editDateReverse:
SortDescriptor<T>(\.editDate, order: .reverse)
}
}
}
Which is used in
struct ItemsList: View {
@Environment(\.modelContext) private var modelContext
@Query private var items:[Item] = []
init(sortStyle:ListSortingStyle<Item> = .alphabetical) {
let sortDescriptor = SortDescriptor<Item>(\.name, comparator: .localized, order: .forward) //(1) This works in preview & simulator
//OR
let sortDescriptor2 = sortStyle.sortDescriptor() //(2) This crashes in a preview when used in a fetch not in the iOS simulator
print(sortDescriptor,sortDescriptor2)
let descriptor = FetchDescriptor<Item>(sortBy:[sortDescriptor2])
self._items = Query(descriptor)
}
var body: some View {
...
}
}
As far as I can see both methods create a SortDiscriptor. If I print the sortDescriptor variable in they look almost identical:
//1
SortDescriptor<Item>(
order: Foundation.SortOrder.forward,
keyString: nil,
comparison: Foundation.SortDescriptor<MyApp.Item>.AllowedComparison.comparableString(
(extension in Foundation):Swift.String.StandardComparator(options: __C.NSStringCompareOptions(rawValue: 0),
isLocalized: true,
order: Foundation.SortOrder.forward),
\Item. <computed 0x0000000340213b18 (String)>)
)
//2
SortDescriptor<Item>(
order: Foundation.SortOrder.forward,
keyString: nil,
comparison: Foundation.SortDescriptor<MyApp.Item>.AllowedComparison.comparableString(
(extension in Foundation):Swift.String.StandardComparator(options: __C.NSStringCompareOptions(rawValue: 0),
isLocalized: true,
order: Foundation.SortOrder.forward),
\Item.<computed 0x0000000340022174 (String)>)
)
But the one created with the generic method on the enum crashes with the error message:
CrashReportError: Fatal Error in DataUtilities.swift
MyApp crashed due to fatalError in DataUtilities.swift at line 64.
Couldn't find \Item.<computed 0x0000000340022174 (String)> on Item with fields [SwiftData.Schema.PropertyMetadata ...
I work on an iOS app, written in Objective-C and C++, that uses a static library. I build this library using a Run Script in Build Phases in Xcode. This is a fat library, containing arm64 code built for iPhoneOS, and x86_64 code built for iPhoneSimulator.
I'm trying to figure out how to create an arm64 iPhoneSimulator build of my app, and I'm running into a problem. If I simply enable arm64 debug builds, I get an error message saying "building for iOS Simulator, but linking in object file built for iOS", indicating that the arm64 iPhoneOS code in the library is not compatible with an arm64 iPhoneSimulator target.
Now, I can build the library as arm64 for iPhoneSimulator, but that means I'll have to build a separate library for the simulator build, since lipo won't combine arm64 iPhoneOS and arm64 iPhoneSimulator builds in one file.
My question: how can I get Xcode to link with a different library for iPhoneSimulator builds than for iPhoneOS builds? All I can come up with is to use completely separate targets for debugging in the simulator vs. debugging on a real device, but that seems ugly.
(It would be even better if I could use the same library for both arm64 iPhoneSimulator and iPhoneOS builds. The library in question is a math library which makes no system calls, so I think the same code should be usable for both builds, if only I could get the linker to allow that.)
Since upgrading from Xcode 15 to 16, we have been experiencing a build error during compilation. Building on Xcode 15 still works with no issues. The error happens only on the first build after a clean. Subsequent builds succeed. This is an issue because our CI process archives the project from a clean slate, and this causes it to fail every time. I will attempt to describe the issue and include information I believe is relevant in this document.
The error occurs on this import line within an Objective-C file during the Scan Dependencies step of compiling. This line imports our custom Objective-C to Swift bridging header file - "Swift2Objc.h".
Our custom Objective-C to Swift bridging header file is simply wrapping the project’s auto-generated Objective-C to Swift bridging header file - "KWISwift.h".
The error is specific to the import of the OfflineServices Swift Package.
Specifically, the OfflineServices-Swift.h file - the Swift Package’s auto-generated Objective-C to Swift bridging file.
Module JRE not found - the exact error (Also included as text on the bottom of the post)
JRE is a third-party library provided to us as an xcframework. It is placed directly into our Swift Package as a binary target.
The xcframework itself is composed of .a file and a Headers folder which includes header files and a module.modulemap.
The module.modulemap file looks like this.
I upgraded xcode to 16.2 and found that the txt file generated by Write Link Map File is different from before, no longer containing detailed data. So, how to set it up to obtain the same link map file as the previous xcode version.
# Path: /Users/....../***.app/__preview.dylib
# Arch: arm64
# Object files:
[ 0] linker synthesized
# Sections:
# Address Size Segment Section
0x00004000 0x00000000 __TEXT __text
# Symbols:
# Address Size File Name
Topic:
Developer Tools & Services
SubTopic:
Xcode
I tried \s+$ to find trailing spaces, but it seems the IDE code editor behaves strangely - it locates random lines that obviously has no trailing spaces.
Did I misunderstand regex in the editor?
Is anyone else having trouble with the Documentation in the latest Xcode beta? I can't get any UIKit documentation to appear. UIKit is completely missing from the table of contents too. I've tried deleting the documentation caches but it isn't helping.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi everyone,
I'm encountering an issue when trying to run Xcode Previews for my HelloWorldApp on a real iPhone device. The app fails to install, and I get the following error message:
Development Environment:
Xcode Version: 16C5032a
macOS Version: 23H420
Test Device (iPhone): iPhone 12 mini, iOS 15.5 (19F77)
MacBook: MacBook Air (M1, arm64e)
Error Message:
Whenever I attempt to preview the app using SwiftUI Previews on my iPhone (iPhone của Định), I get the following installation error:
FailedToInstallAppError: Failed to install ”HelloWorldApp.app”
Could not install the preview host ”HelloWorldApp.app” on iPhone của Định
Here’s part of the detailed log:
agentBundle = com.DihNgx.HelloWorldApp {
url: file:///Users/dihngx/Library/Developer/Xcode/DerivedData/HelloWorldApp-eyeszqttvaydocbdmoiwcczlazrt/Build/Intermediates.noindex/Previews/iphoneos/HelloWorldApp/Products/Debug-iphoneos/HelloWorldApp.app
signingInformation:
Code Signing {
identifier: com.DihNgx.HelloWorldApp
identity: A9A830FA23874E2047C974D6621D441EB9CBC7CC
hasGetTaskAllow: true
isSandboxed: false
}
}
Device Information:
Device Name: iPhone của Định
Device Identifier: 00008101-001C482922C0001E
iOS Version: 15.5
Provisioning profile installed: "iOS Team Provisioning Profile: com.DihNgx.HelloWorldApp"
Steps I’ve already tried (but the issue persists):
Ensured that Xcode recognizes the iPhone and that the device is connected properly.
Checked Code Signing and Provisioning Profile (no issues were shown).
Cleaned the build folder (Cmd + Shift + K) and deleted Derived Data.
I’d really appreciate any advice or suggestions on how to solve this issue. Has anyone else faced a similar error or knows how to fix this? Thanks so much in advance!
Hey Apple Team!
We recently updated to Xcode 16 and saw a massive memory spike, which caused "Out of memory" Mac warnings in the final stages of our app's build process.
We noticed that the process responsible for this is "EmbeddedBinaryValidationUtility" (see screenshot).
Is there a workaround to limit its memory usage? This is causing significant anguish for our developers.
I am trying to find a way to copy the signed target from Xcode Release build to a local directory as part of the build process.
If I use a "run script" build phase it executes BEFORE the target is signed, so will not accomplish that goal.
If I use a "copy file" build phase, it does have an option for signing and so that does "work"; however it always copies the DEBUG version.
Is there a way to copy the Release build target?
EG can a run script execute the code sign program, and, if so what would the command line parameters be? OR
is there a way to modify the copy file phase to copy the Release build rather than the Debug build? OR
??
Topic:
Developer Tools & Services
SubTopic:
Xcode
the Xcode Version 16.2 (16C5032a),
I want to know how to setup a directory in Xcode project when develop the iOS app.
Here is the whole thing:
I start a new iOS App project "test_path".
then I right click, and choose "New Folder", to make a new folder "configx"
then I right click on the configx folder, and choose the "add files to test_path", add a file in it
But the folder does not exist in the project when try to access by "Bundle.main.urls" func.
5. when ls in the Mac, /data/Containers/Bundle/Application/E4F11903-3FAD-467F-A4CD-60AC68D64934/test_path.app, the file just at the root path of test_path.app, no "configx" folder ahead the file.
so, how to setup a directory or a path in iOS project?
I've observed a significant performance regression in Apple Clang 16 (Xcode 16.0/16.2) compared to Clang 15 (Xcode 15.2) when processing flutter aot compilation. Further research shows that clang -cc1as process became extremely slow. The compilation time has increased by approximately 4x.
Environment
Machine: Apple M2 (8C8T)
Memory: 16GB
macOS Version: 14.7.2
Target: Flutter AOT compilation (snapshot_assembly.o)
Performance Comparison
Xcode Version
iOS SDK
Duration
15.2
17.2
1:08.90
15.2
18.2
1:03.98
16.2
17.2
4:11.07
16.2
18.2
4:08.43
16.0
18.2
4:29.32
Reproduction Steps
The issue can be reproduced with the following command which is generated by flutter aot_assembly_release process:
time ${xcode_app_path}/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc \
-arch arm64 \
-miphoneos-version-min=12.0 \
-v \
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk \
-c ${project_path}/.dart_tool/flutter_build/f9ebf46f040933de7c8d103c84d38156/arm64/snapshot_assembly.S \
-o ${project_path}/.dart_tool/flutter_build/f9ebf46f040933de7c8d103c84d38156/arm64/snapshot_assembly.o
Additional Information
This issue specifically affects large assembly files generated by Flutter's AOT compilation
The performance regression appears to be consistent across different iOS SDK versions
The same assembly file compiles significantly faster with Xcode 15.2
Same performance regression observed on M4 Mac mini, suggesting this is not hardware-specific
Size of object:
size -m ${project_path}/.dart_tool/flutter_build/f9ebf46f040933de7c8d103c84d38156/arm64/snapshot_assembly.o
Segment : 64577616
Section (__TEXT, __text): 26603344
Section (__DATA, __bss): 48 (zerofill)
Section (__TEXT, __const): 21292928
Section (__DWARF, __debug_abbrev): 61
Section (__DWARF, __debug_info): 8934534
Section (__DWARF, __debug_line): 4464443
Section (__LD, __compact_unwind): 3282208
total 64577566
total 64577616
Questions
Is this a known issue with Apple Clang 16?
Are there any workarounds or compiler flags we can use to improve the performance?
Is this behavior expected or should it be considered a regression?
Any insights or suggestions would be greatly appreciated.