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

About compiling code on another Apple Silicon Mac.
Hello everyone, I currently have a M1 Pro MacBook Pro (16gb) and a M1 Mac Mini (8gb), and I was searching a way to use the computing power of the Mac Mini to build my projects, even being a less powered machine, I think it can help since it will be doing just one thing. I wanted to normally write code on the MacBook, but instead of building it locally (including the previews), it will be done on the Mac Mini via network connection or even Thunderbolt Bridge (if possible). On a past Apple event (Oct. 30, 2018), was said that it was possible (31:00), but I was not able to find any kind of documentation or guidance on that. Event Video: https://youtu.be/bfHEnw6Rm-4?si=6wyoCLnWyyqG3Qm6
1
1
181
Feb ’25
Command line name "app-store" is deprecated. Use "app-store-connect" instead.
Hi, I've noticed a warning during export archive phase (xcrun xcodebuild -exportArchive) in our iOS CI/CD pipelines. Updating the export options info plist file to use <key>method</key> <string>app-store-connect</string> helps, but I am not sure if we should update it or not since I cannot find any references about this change in the docs. It'd be very helpful to get some guidelines. Thank you
1
0
1.2k
Feb ’25
Swift playgrounds and display orientation swift student challenge submission
I was developing my app on Xcode and I saw in requirements it says “your submission must be an app playground (.swiftpm) I reckon I can develop in Xcode and then copy those files in playgrounds app, make some changes, for it to work. also I made my project in landscape mode in Xcode, in playgrounds can I lock display orientation through package.swift file or I should continue making me app in landscape mode and ask players to change their viewing orientation via a popup?
2
1
355
Feb ’25
Xcode quit working
When I try to open Xcode, it tries to open the previous windows and load up the project I was last working on, but I can’t create a new project without opening Xcode, and I can’t do that; it just quits and gives me an Xcode quit unexpectedly, and it still happens when I download earlier versions of Xcode from the Apple developer website and the latest from the App Store, and I even when in Finder and tried to open my project that way, and it just does the same thing. I have tried everything, and I mean everything. I even reinstalled macOS, and it worked for a minute until it tried to open my project and then quit again and is doing the same thing.
1
0
256
Feb ’25
XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks
Hi, we are experiencing a strange issue with our Web App. Our web app runs entirely on the same domain , and we are making several AJAX requests to the same server. The Error occurs only on Iphones, the app works completely fine on androids and computers. Most of the requests work fine, but suddenly, one specific request always fails with the following error: XMLHttpRequest cannot load https://demo2.artios.cz/app37g/v105/php/endpoint.php due to access control checks What we have checked so far: ✅ CORS headers seem correct. Also we operate entirely on the same domain, client and server. ✅ The same request works fine in computer and android devices. ✅ The issue occurs only on iPhone (tested on Chrome and Safari). ✅ Some requests to the same endpoint pass, but suddenly, this specific request always fails. ✅ There is no OPTIONS preflight request logged in the network tab, but we use only simple requests. ✅ We are making a POST request with multipart/form-data. What is Your advice, or where I can find more info about this error? We do not think the CORS is the problem. We have tried to inspect with WebInspector but with no relevant answers. Thank You very much!
0
1
498
Feb ’25
Xcode asset validation failed
Hi all, First time trying to upload a game to the App Store, having some trouble with it. I have managed to build my Unity Project and get it onto Xcode, but when I click "distribute app" it is giving me this error. Asset validation failed, Invalid Bundle. The bundle at (app name).app/Frameworks/UnityFramework.framework' contains disallowed file 'Frameworks'. Xcode version 16.2 Unity editor version 2022.3.30f1 Anyone know how to get past this? Many thanks!
1
0
294
Feb ’25
Prevent Xcode from injecting UIRequiredDeviceCapabilities
Xcode 16.2 suddenly injects the UIRequiredDeviceCapabilities key into our app's Info.plist. This results in a rejection from App Store Connect because of this key: TMS-90109: This bundle is invalid - The key UIRequiredDeviceCapabilities in the Info.plist may not contain values that would prevent this application from running on devices that were supported by previous versions. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/#qa/qa1623/_index.html The setting INFOPLIST_KEY_UIRequiredDeviceCapabilities is empty in our project, yet Xcode still injects: <key>UIRequiredDeviceCapabilities</key> <array> <string>arm64</string> </array> How can we prevent that? Or is there a way to strip it out during the build process? The Info.plist seems to get generated during an invisible build step, is there a way to make this explicit?
3
1
489
Feb ’25
About Xcode and GitHub
So I started a project in Xcode but without GitHub. Now I have prepared Xcode for GitHub and kind of made it work. I have also made a folder where I have cloned my project from GitHub. So is there any way to connect Xcode and the new folder. If I save my project it doesn't know about my new folder I presume: I could continue to use GitHub via Xcode but I'm afraid I will forget about commands in Git if I only use Xcode. If I should work on another project without Git.
1
0
223
Feb ’25
Building visionOS app with Firebase Source Distribution in Xcode Cloud
I have a working Xcode Cloud setup for my iOS and macOS targets, and I'm trying to add visionOS support. The issue is that Firebase requires using their source distribution for visionOS (instead of their default binary distribution). Locally, this works by launching Xcode with: open -a Xcode --env FIREBASE_SOURCE_FIRESTORE project.xcodeproj For Xcode Cloud, I've added a ci_post_clone.sh script that sets this environment variable for visionOS builds: #!/bin/bash if [[ $CI_PRODUCT_PLATFORM == "xrOS" ]]; then echo "Running setup for visionOS..." export FIREBASE_SOURCE_FIRESTORE=1 fi However, I'm getting the following error during build: an out-of-date resolved file was detected at /.../project.xcworkspace/xcshareddata/swiftpm/Package.resolved, which is not allowed when automatic dependency resolution is disabled So since setting FIREBASE_SOURCE_FIRESTORE=1 changes which SPM dependencies are required: Normal setup uses: abseil-cpp-binary, grpc-binary Source distribution needs: abseil-cpp-swiftpm, grpc-ios, boringssl-swiftpm What's the recommended way to handle this in Xcode Cloud when maintaining builds for all platforms? Should I be using separate workflows with different branches for different platforms? Or is there a better approach? System: Xcode 16.2 Using SPM for dependency management Firebase iOS SDK 10.29.0 Building for iOS, macOS, and visionOS Thanks in advance for any guidance!
0
1
440
Feb ’25
Swift UI Missing argument for parameter in @main app call in List View
Hello, I am building an app that records a list view of projects in contentView. I am in Xcode 16.2. I am having trouble when calling contentView in my @main app file and on the ContentView() line shown in the App file shows that ther is a "Missing argument for parameter 'project' in call". It prompts me to fix it with "Insert', project: ,#Project#.>". However when I do this like the following: ContentView(project: Project) It says "Cannot convert value of type 'Project.Type' to expected argument type 'Project'" These are my Code below //Model import Foundation import SwiftUI struct Project: Identifiable { var name: String var icon: String var isFavorite: Bool var color: Color let id = UUID() var compoundscore : Float static func CurrentProjects() -> [Project] { return [Project(name: "Test Project", icon: "🍎", isFavorite: true, color: .red, compoundscore: 4.5), Project(name: "Swimming", icon: "🏊", isFavorite: false, color: .orange, compoundscore: 12.5), Project(name: "Archery", icon: "🏹", isFavorite: false, color: .yellow, compoundscore: 37.5) ] } } // App view where the error is import SwiftUI @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView(project: Project) } } } // Content View struct ProjectRow: View { let project: Project var body: some View { HStack { Text(project.icon) .font(.title) Text(project.name) Spacer() Image(systemName: project.isFavorite ? "heart.fill" : "heart") } } } struct ContentView: View { var CurrentProjectlist = Project.CurrentProjects() var project: Project var body: some View { NavigationView { List { Section { if #available(iOS 17.0, *) { ForEach(CurrentProjectlist) { project in ProjectRow(project: project) } .listRowBackground( Capsule() .fill(Color(project.color)) .padding(.vertical, 2).padding(.horizontal, 20) ) .listRowSeparator(.hidden) .foregroundColor(.indigo) } else { // Fallback on earlier versions } } header: { Text("CI Projects") } .listRowBackground(Color.blue) .foregroundColor(.black) .listRowInsets(.init(top: 0, leading: 40, bottom: 0, trailing: 40)) .listRowBackground(Color.black) .listSectionSeparatorTint(.yellow) .headerProminence(.increased) .listRowInsets(EdgeInsets.init(top: 0, leading: 50, bottom: 0, trailing: 50)) } .scrollContentBackground(.hidden) .background( Image("cool background") .resizable() .scaledToFill() .clipped() .edgesIgnoringSafeArea(.all) .blur(radius: 3) .overlay(Color.red.opacity(0.2)) ) .environment(\.defaultMinListHeaderHeight, 20) .environment(\.defaultMinListRowHeight, 70) .navigationTitle("Navigator") } } }
1
0
459
Feb ’25
Can't add capabilities in Xcode
We had push notifications and associated domains capabilities to our app but something happened either with my certificates or Xcode and they disappeared and can't add any capabilities anymore. https://imgur.com/peRXNO6 Our App ID, certificate and provisioning profile are all correct and contain the correct capabilities.
8
1
2.7k
Jan ’25
Is debugging with App Data broken?
Trying to use App Data on Xcode 16.2, and failing I'm running the app with the debugger. When I run the app, I need to do a handful of things, which affects my app's cache files, and UserDefaults. What I'd like to do is store all of these settings, then have them loaded in when the app launches, so I don't need to do same, tedious work of changing settings by hand in the UI. So, I discovered that I can provide an xcappdata directory in the Run options. This seems like exactly what I'm looking for. But I can't seem to get it to work. Like, when the app runs, it looks like none of those settings are brought in. I ran the app on a device, and pulled down the application data, and then put that in the project. And you can see in the screenshot, that the value is set. So, either I'm missing something (which is totally possible) or this feature is broken. Documentation on this is not great, so maybe I'm doing something wrong. If the feature is known to be broken, I'll give up on this. But if it should work, it would be great to get some tips here.
0
0
192
Jan ’25
Xcode 16.2 crashes while resolving dependencies
After upgrading to xcode 16.2 I see the following crash when resolving dependencies via command line: ** INTERNAL ERROR: Unable to load workspace '....' ** Uncaught Exception: *** -[NSMutableArray insertObjects:atIndexes:]: count of array (15) differs from count of index set (14) Stack: 0 __exceptionPreprocess (in CoreFoundation) 1 objc_exception_throw (in libobjc.A.dylib) 2 -[__NSCFString characterAtIndex:].cold.1 (in CoreFoundation) 3 -[NSMutableArray insertObjects:atIndexes:] (in CoreFoundation) 4 __50-[IDEGroup insertGroupSubitems:atIndexes:context:]_block_invoke (in IDEFoundation) 5 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation) 6 -[IDEGroup insertGroupSubitems:atIndexes:context:] (in IDEFoundation) 7 -[NSMutableArray(DVTFoundationClassAdditions) dvt_sortedInsertOfObjects:withComparator:] (in DVTFoundation) 8 specialized IDESPMWorkspaceDelegate.registerDependencyFileReferences(_:modelGraphSynchronizerToken:) (in IDESwiftPackageCore) 9 specialized IDESPMWorkspaceDelegate.dependencyPackagesDidUpdate(packages:graphHasErrors:revalidatedFilePathCaches:modelGraphSynchronizerToken:) (in IDESwiftPackageCore) 10 closure #1 in IDESPMWorkspaceDelegate.packageGraphDidFinishAction(_:duration:result:) (in IDESwiftPackageCore) 11 partial apply for closure #1 in IDESPMWorkspaceDelegate.disableWorkspaceContentSynchronization(during:) (in IDESwiftPackageCore) 12 closure #1 in DVTModelObjectGraph.performBlockCoalescingModelChanges<A>(_:) (in DVTFoundation) 13 thunk for @callee_guaranteed () -> (@owned [String : NSObject]) (in DVTFoundation) 14 thunk for @escaping @callee_guaranteed () -> () (in DVTFoundation) 15 __58-[DVTModelObjectGraph performBlockCoalescingModelChanges:]_block_invoke (in DVTFoundation) 16 -[DVTModelGraphTransactionScope performTransaction:] (in DVTFoundation) 17 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation) 18 DVTModelObjectGraph.performBlockCoalescingModelChanges<A>(_:) (in DVTFoundation) 19 IDESPMWorkspaceDelegate.disableWorkspaceContentSynchronization(during:) (in IDESwiftPackageCore) 20 IDESPMWorkspaceDelegate.packageGraphDidFinishAction(_:duration:result:) (in IDESwiftPackageCore) 21 partial apply for thunk for @escaping @isolated(any) @callee_guaranteed @async () -> () (in IDESwiftPackageCore) 22 SPMWorkspace.packageGraphActionFinished(_:) (in SwiftPM) 23 closure #2 in closure #3 in SPMWorkspace.processPackageGraphActionsInBackgroundIfNeeded(canProcessPackageGraphActions:) (in SwiftPM) 24 dispatch thunk of SPMWorkspaceOrchestrationDelegate.packageGraphDidFinishAction(_:duration:result:) (in SwiftPM) 25 specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (in SwiftPM) 26 partial apply for specialized thunk for @escaping @isolated(any) @callee_guaranteed @async () -> (@out A) (in SwiftPM) 27 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) (in libswift_Concurrency.dylib) sh: line 1: 24112 Abort trap: 6 env NSUnbufferedIO=YES xcodebuild -scheme XXX-Package -destination 'platform=iOS Simulator,id=950768B8-85B4-4250-A7EC-5AE8758369EE' -derivedDataPath .DerivedData -resultBundlePath '/.../XXX-Package.xcresult' -enableCodeCoverage YES -skipPackagePluginValidation -skipMacroValidation -disablePackageRepositoryCache build test``` Are there any workaround for this?
4
1
1.1k
Jan ’25
Is it possible to read japanese tategaki with vision framework
We are building an app which can reads texts. It can read english and Japanese normal texts successfully. But in some cases, we need to read Japanese tategaki (vertically aligned texts). But in that times, the same code gives no output. So, is there any need to change any configuration to read Japanese tategaki? Or is it really possible to read Japanese tategaki using vision framework? lazy var detectTextRequest = VNRecognizeTextRequest { request, error in self.resStr="\n" self.words = [:] // Get OCR result guard let res = request.results as? [VNRecognizedTextObservation] else { return } // separate the words by space let text = res.compactMap({$0.topCandidates(1).first?.string}).joined(separator: " ") var n = 0 self.wordArr=[[]] self.xs = 1 self.ys = 1 var hs = 0.0 // To compare the heights of the words // To get the original axis (top most word's axis), only once for r in res { var word = r.topCandidates(1).first?.string self.words[word ?? ""] = [r.topLeft.x, r.topLeft.y] if(self.cartLabelType == 1){ if(word?.components(separatedBy: CharacterSet(charactersIn: "//")).count ?? 0>2){ self.xs = r.topLeft.x self.ys = r.topLeft.y } } } } }
2
1
570
Jan ’25