Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Xcode build crashes on: No such module '_SwiftData_SwiftUI'
Building with below imports returns an error. What could I do to mitigate this? I did clean the build cache and delete the derived data folder. import SwiftData import SwiftUI The error: Command SwiftCompile failed with a nonzero exit code /Users/thomas/Documents/Projects/SwiftUI/workouts/Workouts/Workouts/Views/Workout/WorkoutView.swift:9:8 No such module '_SwiftData_SwiftUI' This feedback has also been submitted under: FB14182548
2
1
180
2w
Issue with Core Simulator Cache Consuming Disk Space
I recently ran out of disk space and discovered that my System Data was consuming 866 GB of storage. After investigating, I found multiple directories named "Dead" nested within my developer data, consuming nearly 600 GB of storage. An example path is: /Users//Library/Developer/CoreSimulator/Devices//data/Library/Caches/com.apple.containermanagerd/Dead These directories contained multiple directories titled "temp.". Rebooting the computer did not empty these "Dead" directories; I had to manually delete them. What is the expected lifespan of the temporary directories stored in the "Dead" directory?
1
0
164
2w
Attempted to install a Beta profile without the proper entitlement.
I'm trying to install from Xcode (15.4) to my physical device (iPhone SE 3rd gen, iOS 17.5.1) but I get the following error. My provisioning profile is from a 3rd party organization, but I have confirmed my device UUID is added to their account and that the profile does contain the beta-reports-active flag. I have also checked that this is added to the entitlements file. It works fine it I deploy and install via TestFlight, but for obvious reasons I would prefer not to have to do that for each and every build. Can anyone suggest how to resolve this, either with local config or by asking the account admin to modify the provisioning profiles? Unable to Install “[redacted]” Domain: IXUserPresentableErrorDomain Code: 14 Recovery Suggestion: Failed to install embedded profile for [redacted] : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.) User Info: { DVTErrorCreationDateKey = "2024-07-03 12:47:34 +0000"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; } -- Unable to Install “[redacted]” Domain: IXUserPresentableErrorDomain Code: 14 Recovery Suggestion: Failed to install embedded profile for [redacted] : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.) User Info: { IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; } -- Failed to install the app on the device. Domain: com.apple.dt.CoreDeviceError Code: 3002 User Info: { NSURL = "file:///Users/dan/Library/Developer/Xcode/DerivedData/iosApp-gxsprezneuyftnhbmfyfssbeojgd/Build/Products/Debug%20development-iphoneos/[redacted].app/"; } -- Unable to Install “[redacted]” Domain: IXUserPresentableErrorDomain Code: 14 Failure Reason: This app cannot be installed because its integrity could not be verified. Recovery Suggestion: Failed to install embedded profile for [redacted] : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.) -- Failed to install embedded profile for [redacted] : 0xe800801f (Attempted to install a Beta profile without the proper entitlement.) Domain: MIInstallerErrorDomain Code: 13 User Info: { FunctionName = "-[MIInstallableBundle _installEmbeddedProfilesWithError:]"; LegacyErrorString = ApplicationVerificationFailed; LibMISErrorNumber = "-402620385"; SourceFileLine = 308; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_isCoreDevice" = 1; "device_model" = "iPhone14,6"; "device_osBuild" = "17.5.1 (21F90)"; "device_platform" = "com.apple.platform.iphoneos"; "dvt_coredevice_version" = "355.28"; "dvt_mobiledevice_version" = "1643.100.60"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 3497; "operation_errorCode" = 14; "operation_errorDomain" = IXUserPresentableErrorDomain; "operation_errorWorker" = IDEInstallCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 99; "param_launcher_substyle" = 8192; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos17.5"; "sdk_osVersion" = "17.5"; "sdk_variant" = iphoneos; } -- System Information macOS Version 14.3 (Build 23D56) Xcode 15.4 (22622) (Build 15F31d) Timestamp: 2024-07-03T13:47:34+01:00
1
0
369
2w
Unable to use SWIFT_EXPLICIT_MODULES
I'm following the guidance from [wwdc24/10171] using Xcode 16 beta 2 on Sonoma (https://developer.apple.com/wwdc24/10171) and find myself unable to active the _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES = YES setting. I tried both in the project file and in the XCConfig file and nothing. After cleaning and building with timing summary, I can't find any "Compiling Swift module" nor any "modules report". I only get multiple statements of "Compiling clang module" and the "GenerateClangModulesReport" What am I doing wrong?
1
0
189
2w
Push notifications are not displaying when app is in foreground
I have some C++ code to embed in my Application and hence enabling the setting C++ and Objective C ++ compatibility settings to C++/objective-C++ under build settings of my project .Once I enable it I am not receiving any push notification display when I'm in foreground even though I have the required willPresent function handler in app delegate. Also observed that the code is going into didReceiveRemoteNotification function handler. But once I disable the setting or change the setting to c/objective-c,then the flow is working fine and I'm getting the push notification on foreground. Request you to please help me here
1
0
149
2w
Instruments false positives
I have been able to get rid of reported memory leaks in Instruments not by fixing a leak but by adding some lines (like releasing a previous nil object) that convinced Instruments it is not a leak. But I am stuck are some I cannot stop Instruments from reporting. It reports a leak in this code if(expr.length>0) { // add previous Atomic Atomic *atom = [[Atomic alloc] initWithString:[string substringWithRange:expr] isNumber:aNum]; [exprTokens addObject:atom]; [atom release]; } } and it underlines the substringWithRange method. I changed code to explicitly release atom and I assumed substringWithRange would return an autoreleased new string. I am aware Instruments tells you where the leaked object is created and not where it is leak, but only things created here are atom and a sub string and atom is released immediately. The initWithString method might do it, but I don't find anything there. Also, while running instruments, this code is 8542 times (I am pretty sure always in the same context) and Instruments says it only leaks 61 times. I don't now if there is misunderstanding are a code problem?
1
0
203
3d
Predictive code completion is not supported in this region
I'm using beta 2 of Xcode 16 on an M1 MacBook with 32 GB of memory, running macOS 15 beta 2. It didn't appear that predictive code completion was working as exhibited in the developer videos, so I tried to figure out what's going on. The Xcode documentation mentions that you can disable predictive code completion in Settings, so I checked there. The checkbox to turn it on is disabled. When I click the "I" button to its right, it tells me that "Predictive code completion is not supported in this region." I am in the US with my system set to US English. What do I have to do to be able to experience this feature?
2
1
248
2w
iOS simulator glitching erratically constantly
I am using an iPhone 15 Pro as my iOS simulator, and the IDE that I am using is Android Studio. This issue is happening on a 2019 MacBook Pro 16 inch, running the latest version of Xcode, and running macOS Sonoma 14.5. I've never had this issue on other, older/newer Macs with Android Studio. Everytime I interact with the simulator, it shows green bars and distorts the view quite a bit (See screenshots below). I tried all that I could think of, including, but not limited to: Restarting simulator, restarting MacBook, restarting Android Studio, using different iOS simulators (same problem), and so forth. I have not found any such occurrence to anyone else while looking online for answers. One interesting thing that I noticed is that for Xcode projects, the simulator runs perfectly, but when I use Android Studio, the simulator doesn't work properly at all. Any solutions to this? All input is greatly appreciated. P.S.: I have tested the app on an actual iOS device, and it works perfectly. Here are some screenshots. This show what happens when you scroll or interact with the app: (Each screenshot is a different interaction)
2
1
167
4d
Can I preview "regular" view in widget extension?
Basically, in my widget/live activity, I want to extract reusable views into a separate file with an isolated view and preview. Dummy example below. I cannot do it because it says "missing previewcontext". The only way I've found is to add the view to my main app target, but I don't want to clutter my main app wiews that only exist in my widgets if I can avoid it. Can this be done somehow? Thoughts appreciated. Dummy example (tried with and without "previewLayout": struct StatusActivityView: View { let status: UserStatusData var body: some View { VStack(alignment: .center) { Text("Dummy example") }.background(.blue).padding(5) } } @available(iOS 16.2, *) struct StatusActivityView_Previews: PreviewProvider { static var previews: some View { let status = WidgetConstants.defaultEntry() return StatusActivityView(status: status).previewLayout(.sizeThatFits) } }
2
0
197
2w
code object is not signed at all In subcomponent ...
I'm a newbie in Mac development and Xcode. Trying to revive an old cross-platform open source project of mine and to continue its development on Xcode. A new project setup was created using CMake. Managed to compile the project with the required dependencies outside Xcode. If I try to build the project in Xcode, the only error is: Command CodeSign failed with a nonzero exit code Details: ... zzzz.app code object is not signed at all in subcomponent ... Found a similar question in this forum: https://forums.developer.apple.com/forums/thread/701261 Tried to follow the recommendations there, but without success. The subcomponent in question is simply text files (xpm) which are used by the application during runtime, and are supposed to be copied in the app/Contents directory Will appreciate any help Further details on the setup: (Signing and Capabilities): Signing is automatic; Team: "None"; Bundle identifier: empty Signing certificate: "Sign to run Locally" (Build phases): Tried to check "Code Sign on Co..." - no difference If I check "Copy only when installing" - it builds fine, yet it is not copying my resource files in my zzzz.app/Contents directory Xcode Version 15.3 (15E204a) The project is in GitHub
0
0
307
3w
Is there anyway to view output from an Xcode scheme's build pre-action / verify it completed successfully?
I've got a custom run script build phase in my Xcode iOS project, however I want it to run before the items in the Target Dependencies section get built. So I added a Pre-Actions phase to the target's build scheme and pasted the contents there. However, during a build, there's no way to see if the stuff in the pre action is successful or not. It's possible to put echo statements into a run script build phase which is useful to print values such as file paths etc. but these don't work when part of a scheme pre action. Also if I deliberately put garbage into the scheme pre action, then I can see Xcode is still running the pre action, but as its full of garbage it should fail, but Xcode doesn't report any errors anywhere. So, is there any way to see and confirm if a scheme pre-action was successful or not, or to output logging statements from it to verify values its using are as expected?
0
0
151
3w
Swift Package with Demo project with Xcode 16
My current workflow to have a Swift Package with a Demo is like this: PackageFolder > DemoFolder I have a package, with a Demo folder inside. I can open the Demo project and Drag&Drop the local PackageFolder to override the remote dependency with the local one. This allows to edit the package while inside the demo project. With Xcode 16 this does no longer work because Xcode does not allow to drop an ancestor of the file path where the project is located. Xcode does not tell this while you drop, it just does not allow it. But it tells you thats the reason, when you try to add the local package as a dependency to the project: "The selected package cannot be a direct ancestor of the project.". (Dropping other local packages still works, see: https://forums.developer.apple.com/forums/thread/756824) What is the expected way to handle a package with a demo project with Xcode 16?
2
2
278
3w
"Your Request Couldn't Be Processed" While Enrolling Into Developer Program
I am trying to enroll in the developer program by following below steps. Open apple developer app Clicks on my account name Clicks on 'Enroll Now' button Filled all details Opens up "Program License Agreement" & Clicks "Agree" Clicks "Agree" on the "Confirm Agreement" This process is showing "Your request could not be processed."
1
0
164
2w
Define Custom Tests in Xcode project template
I am using a custom app project template and I would like to also include custom Test files (or implementation) when I select to add Swift Testing or XCTest. What should I add to my TemplateInfo.plist to either extend or override the default templates? This is not documented by Apple and it's hard to figure out. Thanks in advance for any help.
0
0
124
3w
Xcode Accessibility audit in UI Tests gives less than stellar results
I have added a UI test that uses the newish app.performAccessibilityAudit() on each of the screens in my SwiftUI app. I get a handful of test failures for various accessibility issues. Some of them are related to iOS issues (like the "legal" button in a map view doesn't have a big enough tappable are; and, I think, there is a contrast issue with selected tabs in a tab bar, or maybe it is a false positive). Two of the error type I get are around Text elements that use default font styles (like headline) but that apparently get clipped at times and apparently "Dynamic Type font sizes are unsupported". For some of the errors it supplies a screenshot of the whole screen along with an image of the element that is triggering the error. For these text errors it only provides the overall image. After looking at the video I saw that part of the test runs the text size all the way up and I could see that at the largest size or two the text was getting cut off despite using default settings for the frames on all the Text elements. After a bit of trial and error I managed to get the text to wrap properly even at the largest of sizes and most of the related errors went away running on an iPhone simulator. I switched to an iPad simulator and the errors re-appeared even though the video doesn't show the text getting clipped. Does anyone have any tips for actually fixing these issues? Or am I in false positive land here? Also, is there any way to get more specific info out of the test failures? Looking at the entire screen and trying to guess where the issue is kinda sucks.
0
2
371
3w