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

Xcode Documentation

Pinned Posts

Posts under Xcode tag

3,058 Posts
Sort by:
Post not yet marked as solved
0 Replies
54 Views
I've created a Full Immersive VisionOS project and added a spacial video player in the ImmersiveView swift file. I have a few buttons on a different VideosView swift file on a floating window and i'd like switch the video playing in ImmersiveView when i click on a button in VideosView file. Video player working great in ImmersiveView: RealityView { content in if let videoEntity = try? await Entity(named: "Video", in: realityKitContentBundle) { guard let url = Bundle.main.url(forResource: "video1", withExtension: "mov") else {fatalError("Video was not found!")} let asset = AVURLAsset(url: url) let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer() videoEntity.components[VideoPlayerComponent.self] = .init(avPlayer: player) content.add(videoEntity) player.replaceCurrentItem(with: playerItem) player.play() }else { print("file not found!") } } Buttons in floating window from VideosView: struct VideosView: View { var body: some View { VStack{ Button(action: {}) { Text("video 1").font(.title) } Button(action: {}) { Text("video 2").font(.title) } Button(action: {}) { Text("video 3").font(.title) } } } } In general how do I control the video player across views and how do I replace the video when each button is selected. Any help/code/links would be greatly appreciated.
Posted Last updated
.
Post not yet marked as solved
2 Replies
74 Views
Recently we have started refactoring some code to use Swift concurrency in Xcode 15.3. As we have added some new async methods and Tasks, new runtime warnings have emerged titled "Known Hang" and several are listed. None of the stack traces listed with these warnings are in areas directly modified but some of the same types/methods called are also called from the modified areas. So I can sort of understand why they are coming up...but they had to have been there before we added the Swift concurrency. Example of a tooltip with the warnings: My first query is: Are these warnings only issued when Swift concurrency is added/applied (as they were not there when using closures and mostly just off the main thread to network calls)? The documentation indicates these can all be suppressed by turning off the Thread Performance Checker BUT I would rather just suppress the few places as we refactor our codebase (as it is quite large). In that way, any new ones may be documented and we can decide to fix them now or later. I have tried to follow the instructions and added an environment variable PERFC_SUPPRESSION_FILE (in the Scheme) with a full path to a file formatted similarly to the example in the documentation. class:NSManagedObjectContext method:-[NSManagedObjectContext save:] My second query is: I have verified that the variable is set by reading it from the ProcessInfo. However, regardless of my settings, the runtime warnings are still presented. I could not find any examples or even any mention of others using this environment variable. I am reaching out with any advice or ideas to try. Has anyone successfully tried this or found an issue/alternative? Help me Mr. Wizard!
Posted
by billdog.
Last updated
.
Post not yet marked as solved
0 Replies
52 Views
Hello, I've upgraded Xcode to newest 15.4 and now I cannot edit text in the output console (debugger). The Xcode console (output) does not allow editing text and does not allow any text input anymore. I've seen that this may be related to structured logging. I used to mark things in console output by typing some notes for me when debugging. How to do that? How to make Xcode console allow input like add line break to mark items in my log, or add notes?
Posted
by slaj.
Last updated
.
Post not yet marked as solved
1 Replies
58 Views
Hi, I am using macOS Sonoma 14.5 and the latest version of Xcode (15.4). Every time I open Xcode, it asks me to install additional components. I accept, but when it finishes, the same dialog appears again. I've done this multiple times. I also uninstalled and reinstalled Xcode, but no luck. Can you please help me?
Posted
by isoldo.
Last updated
.
Post not yet marked as solved
2 Replies
158 Views
When I try to setup my new 13" iPad Pro for development with Xcode I get the following error. Previous preparation error: The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000105 (kAMDMobileImageMounterTATSUDeclinedAuthorization: The server declined to authorize this image on this device for this user.) I have tried many times and tried multiple things like reseting the iPad and starting again. Rebooting both devices. Deleting ~Library/Developer/DeveloperDiskImages Still nothing. This is quite frustrating. Any help appreciated. Ben
Posted
by BenODwyer.
Last updated
.
Post not yet marked as solved
0 Replies
56 Views
Hello fellow developers, We are trying to develop a chatbot application for ios devices using the powers of Oracle Digital Assistant. Main Documentation :- https://docs.oracle.com/en/cloud/paas/digital-assistant/use-chatbot/oracle-ios.html Implementation instructions :- https://blogs.oracle.com/digitalassistant/post/oracle-techexchange-using-the-oracle-ios-sdk-to-integrate-oracle-digital-assistant-in-mobile-applications The point is when we are trying to run the app, we are facing tons of warnings as in below screenshot. Here is the code for the ViewController.swift as below: // // ViewController.swift // ODA_Configure // // Created by Macbook on 15/05/24. // //import UIKit // //class ViewController: UIViewController { // // override func viewDidLoad() { // super.viewDidLoad() // // Do any additional setup after loading the view. // } // // //} // Import the SDK import UIKit import BotClientUISDK public class ViewController: UIViewController { // Declare a global BotsViewController variable in your app view controller class public var chatViewController: BotsViewController? public override func viewDidLoad() { super.viewDidLoad() // Obtain a shared instance of BotsViewController from BotsUIManager chatViewController = BotsUIManager.shared().viewControllerInstance() // Specify the color changes if any in a particular component. Make sure you set all the required colors in BotsProperties before adding the chat view to the view controller. // Add the chatViewController to your navigationController self.navigationController?.pushViewController(chatViewController!, animated: false) // Obtain a shared instance of BotsManager let botsManager = BotsManager.shared() // If you require access to callback methods provided in AuthenticationProvider. Make sure your class conforms to BotsMessageServiceDelegate // botsManager.authenticationTokenProvider = self let baseUrl = "idcs-oda-81e5e7409d52405784089abe830a8820-da12.data.digitalassistant.oci.oraclecloud.com" let channelID = "ff8a2d3f-7d65-4dab-a09a-d8f574ce5b7a" // Initialize a BotsConfiguration object and set feature flags if required. let botsConfiguration = BotsConfiguration(url: baseUrl , channelId: channelID) BotsManager.shared().connect(botsConfiguration: botsConfiguration) // Set the feature flag values if the desired values are different from the default values botsConfiguration.showConnectionStatus = true botsConfiguration.enableSpeechSynthesis = true botsConfiguration.disablePastActions = "none" // Initialize the configuration in botsViewController. Make sure you set all the feature flag values before passing the botsConfiguration to initConfiguration. chatViewController?.initConfiguration(botsConfiguration: botsConfiguration) // If you require access to callback methods provided in BotsMessageServiceDelegate. Make sure your class conforms to BotsMessageServiceDelegate //botsManager.delegate = self // If you require access to callback methods provided in BotsEventListener. Make sure your class conforms to BotsEventListener //botsManager.botsEventListener = self // Initialize and establish connection to the chat server BotsManager.shared().initialize(botsConfiguration: botsConfiguration, completionHandler: { (connectionStatus, error) in if error != nil { print ("Error: \(String(describing: error?.localizedDescription))") } else { print ("Connection Status: \(connectionStatus)") } }) } } After executing this code, we are getting the message as build succeeded , and this is the emulator, which happens to be blank white all the time. Possibly due the warning which I have posted above this seems to be the showstopper in the development. We are developing this for a prestigious client and would request an assistance as soon as possible. P.S :- We are using Xcode 15 with Simulator of version 17.0.
Posted Last updated
.
Post not yet marked as solved
0 Replies
43 Views
Hi, I have been receiving an email error message: ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it. when submitting an app to the App Store Connect using xcode. I have searched for many solutions online, but none of them have worked. Later, I manually created the SwiftSupport directory and copied the Swift dynamic library (dylib) that the app depends on to this directory, as well as copying them to the. app/Frameworks directory. After submitting, I received an email saying that these. dylib dynamic libraries are not in the. app/Frameworks directory. I opened the IPA file and checked the directory, and I really saw that they are located below. I don't know where the problem is, can you tell me the exact reason?
Posted
by forchen.
Last updated
.
Post not yet marked as solved
1 Replies
600 Views
Hello, im a new Apple developper since 2 years. I have Been working hard to learn and trying to publish my first IOS , iPad OS and Mac OS app. My app is taking form but I have few problems with the Xcode simulator to run ''on device'' for my iPad and iPhone. My devices began to disconnect and now I can't connect it anymore to run my code and debug. the are constantly in the state ''Trying to reconnect to '' and "preparing device". I have already reset all my device and deactivate developper mode etc. i have a iPad 7th gen and an iPhone 14 Pro Max . they both have iOS 17.5 beta 2 (trying to fix the problem by keeping those up to date as much as possible.) my Xcode version is 15.4 beta My Mac book air 13 inch 2018 is running Sonoma 14.4.1 and the is no new os version bus its not an apple M family chip. I think there is a Sonoma 14.5 beta version but for apple architecture. I really need your help plz
Posted Last updated
.
Post marked as solved
6 Replies
505 Views
I tried to read an Object : -(NSMutableDictionary*) readMyObject:(NSData*)data; { NSError * error; Class class = [NSMutableDictionary class]; NSMutableDictionary * dict; dict = [NSKeyedUnarchiver unarchivedObjectOfClass:class fromData:data error:&error]; return dict; the result was nil. I searched by Developer for a solution and found one : { // NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiver alloc] init]; [unarchiver decodeObjectOfClasses: [[NSSet alloc]initWithArray: @[[NSDictionary class], [NSMutableDictionary class], [NSArray class], [NSMutableArray class], [NSString class], [NSNumber class]]] forKey:NSKeyedArchiveRootObjectKey]; [unarchiver finishDecoding]; } The first line was from me and it crashed the project. I assume there is an easy answer, not for me.🥲 Uwe
Posted Last updated
.
Post not yet marked as solved
12 Replies
3.6k Views
I just upgraded to XCode15.3 and now all my projects with Assets are getting this compile error. I have tried removing DerivedData caches and rebooting but still get this error. Anyone else hit this problem with XCode 15.3? I was only Building for IOS 16.4 and 17.0.1 and Xcode 14.0 and 15.0 Build Error: Command CompileAssetCatalog failed with a nonzero exit code *** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent) Execution Context: <IBSimulatorToolCoreSimulatorCLIExecutionContext: 0x600003d5d260 busyCount=0, Idle for 0.0 secs, lifeTime=26.3 secs>, device=IBSimDeviceTypeiPad3x (865E7291-E467-4E8D-B535-D64F43A57F15, iOS 17.4, Shutdown), idiom=<IBIPhoneIdiom: 0x6000028b8000>
Posted
by Scorpius.
Last updated
.
Post not yet marked as solved
1 Replies
134 Views
I created a prototype app with Reality Composer on an iPad. Now I would like to import the project to a Mac for further development using Xcode/Swift. How can I do this? I am able to export a .reality or .usdz file. If I open the .reality file in Xcode I just get the playback app/scene but it does not appear to be a project that I can edit.
Posted
by robodizi.
Last updated
.
Post not yet marked as solved
1 Replies
121 Views
Hi, I just got my new iPad Pro 11-inch, M4. I'm trying to hook up with Xcode 15.4 (latest) and got this error message. Previous preparation error: The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000105 (kAMDMobileImageMounterTATSUDeclinedAuthorization: The server declined to authorize this image on this device for this user.) Has anyone experienced the same problem? any ideas? I've tried all sorts of things suggested online (including completely reinstalling Xcode and the iPad - Clearing trusted computers - restarting everything etc.)
Posted
by pungme.
Last updated
.
Post not yet marked as solved
0 Replies
60 Views
Hi community: I'm trying to replace it with drag-and-drop images in assets. I know for example that by adding a suffix @2 and @3, you can drag and drop and Xcode knows where they must be. Also, I remember that it could be possible to add a suffix like ~dark or ~light. There's no official documentation about it but I'm looking a way to drag and drop and autodetect assets per language. I've tried: image_es@fr.png image_fr@2x.png image_fr@3x.png But doesn't work. Any ideas where I can find the docs? Or can someone provide documentation about it? Thanks in advance.
Posted
by JesusMG.
Last updated
.
Post not yet marked as solved
5 Replies
256 Views
Using the latest stable macOS/iPadOS/Xcode: macOS 14.5 (23F79) iPadOS 17.5 (21F84) Xcode 15.4 (15F31d) We're unable to deploy to the new iPad Pro devices. This applies to newly created empty projects as well. We receive the following message: The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000105 (kAMDMobileImageMounterTATSUDeclinedAuthorization: The server declined to authorize this image on this device for this user.) We've tried every suggestion we can find online: Restarting everything Reinstalling everything rm -rf ~/Library/Developer/DeveloperDiskImages/ Turning on/off Developer Mode. Using various internet connection methods (to sidestep potential routing/firewall issues) It happens across all our developer accounts we've tried 5+, and all iPads tried thusfar (around 5).
Posted
by refd981.
Last updated
.
Post not yet marked as solved
2 Replies
342 Views
We are facing an issue on Catalyst when building our app using Xcode 15.4. The issue is related to precompiled frameworks and seems to be widespread as it happens with multiple vendors (like Firebase or Braze). We are using SPM to add these dependencies, for instance: .package(url: "https://github.com/braze-inc/braze-swift-sdk", from: "8.2.1"), When building, we get the following error: clang:1:1: invalid version number in '-target arm64-apple-ios10.15-macabi' Our macOS deployment target is 12.3. Our iOS deployment target is 15.4. I will try to create a reproducer I can share but I wanted to share this in case there's a known workaround. Thanks in advance!
Posted
by 0xpablo.
Last updated
.
Post not yet marked as solved
1 Replies
94 Views
I am developing a suite of apps/helpers that get built into an installer package for deployment (outside The App Store). We have that release process ± working, except that most of the development team members are not admins/privileged on the team. They don't really need to publish on behalf of the team, and so we don't want to have debug builds also depend on being signed as "Developer ID Application". But that is running into problems… If I select instead "Sign to Run Locally" this results in an error for some of the build products along the lines of: [Build Target] requires a provisioning profile. Enable development signing and select a provisioning profile in the Signing & Capabilities editor. If I select "Apple Development" as the Code Signing Identity it leaves me with basically the same error as "Developer ID Application" does: Provisioning profile [Name of App/Helper] doesn't include signing certificate "Apple Development: [Name of Developer] ([TEAMID])" And finally, if simply set the Debug value for Provisioning Profile to "None" for the problematic products I get errors like: "[Name of app]" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. I believe perhaps because some of the targets have an entitlements file granting access to various things (their own XPC services, their own shared preferences, as well as Outgoing Network Connections and com.apple.security.smartcard access…). In older versions of Xcode and/or macOS we didn't have trouble like this, local development could be done by basically any team member. Now it seems like maybe all developers need to have release-signing privileges to test/debug even on their own machines? Or is there a combination I'm missing, that would allow anyone on the team (or perhaps not even on the team) to build and debug the code locally, while still limiting who is able to actually sign notarized release builds on behalf of the team?
Posted
by natevw.
Last updated
.
Post not yet marked as solved
1 Replies
85 Views
Hi, we recently noticed an issue when exporting the localization files from one of our projects. So in the exported .xliff file, there is a string that has been varied into the plural forms of zero, one and other. We had translated them into Japanese. But in the .xliff file, the source element of this string in plural ONE is missing, while the target as well as the others plural strings are showing correct. We've also checked in Xcode (15.3), the content of whether the source or target are there for all the plural forms, as you can see below. The same issue (same string) also exists in Korean and Russian, but not in other languages we support (like German, French, Chinese), which is a bit weird to us. Does anyone have any idea why this is happening and how can we fix it?
Posted
by Yijie-W.
Last updated
.