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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

NSE Filtering Entitlement Rejected Repeatedly – Seeking Advice & Possible Solutions
Hi everyone, I’m facing a major roadblock with my family location tracking app, and I need some advice or guidance from the community. Background Back in 2021, I implemented NSE filtering entitlement to send location-based notifications and retrieve the device's location in return (as suggested by Apple’s technical code support). Over time, I built my app around this entitlement, adding many features that depend on it. When Location Push Service Extension was introduced for iOS 15+, I adapted accordingly: NSE filtering was used for devices below iOS 15 Location Push Service Extension was used for iOS 15+ NSE filtering also played a crucial role in: ✅ Accepting/rejecting location-based notifications ✅ Checking device settings & location permissions (since location push won’t work without proper permissions) The Issue In November 2024, I created a new developer account to change my business entity. Since then, I’ve been requesting the NSE entitlement repeatedly for four months, but Apple keeps rejecting it. Meanwhile, they approved the Location Push Entitlement, but without NSE filtering, I’m forced to rewrite a huge part of my app’s core functionality. I’ve sent multiple emails explaining my use case, but I keep getting rejected without any clear explanation or workaround. My Ask Has anyone faced a similar issue with NSE entitlement? Are there any alternative approaches to achieve the same functionality? Any advice on how to escalate this to Apple or get proper feedback on why it's being rejected? I’ve invested years into this app, and a forced rewrite would take months. Any help, insights, or contacts who could assist would be greatly appreciated! Thanks in advance! 🙏
0
0
60
Mar ’25
[Xcode:BuildSettings] Keep some warnings as warnings while the rest as errors
We have a big iOS project and we are using .xcconfig files to define our compiler options and build settings. We have our SWIFT_TREAT_WARNINGS_AS_ERRORS set to YES so that all Swift related warnings will be reported as errors. Now, we are trying to migrate to Xcode 16.1 and set 'targeted' in the 'Strict Concurrency Checking' flag. This produces some errors that are related to Swift's concurrency checks. We are now planning to have an approach where we still want to keep SWIFT_TREAT_WARNINGS_AS_ERRORS as is but we want all concurrency related warnings to be still treated as warnings while the rest will get reported as errors. We found this new compiler option - https://forums.swift.org/t/warnings-as-errors-exceptions/72925. It looks like the one we want but I think it is still not out yet and we need to wait until Swift 6.1 (correct me if im wrong). Or is there any other way to do what we want to achieve?
0
0
362
Jan ’25
Xcode cannot deploy to Apple Watch SE even once
Got a Watch SE recently only to find out that I can't deploy apps to it from Xcode even once. I always get the message "Connecting to Watch" and "Reconnecting to Watch". Tried with Xcode 16 and then with 16.2. Same result. For countless times, I have tried every possible solution posted on this forum and elsewhere but to no avail. Filed a feedback, no reply yet from Apple. Looks like something is seriously broken. Please fix this. FB16122816
0
0
400
Jan ’25
XCode Error Code: Failed to Save
I have a Mac Mini (M4) running macOS Sequoia 15.3.1. I very recently downloaded and installed the current version of XCode from the app store. I have not added any extensions - it's a vanilla, un-customized, un-enhanced installation. I have two user profiles (accounts) on my Mac: one Administrator and one Standard, each using a different apple account. I am using the Standard user account to learn XCode. When I attempt to set up a project, I get an error message when Xcode initially tries to save the (provided) project template file. The error states: "Failed to save Project2.xcodeproj. The backing file has been modified outside of XCode." I am using a NAS drive to store my project file. I have also tried saving it to the Desktop. It makes no difference to the error wherever the file is being saved. Similarly, I tried changing the Standard user account to an Administrator account to see if it was a privileges problem. Again, it made no difference to the error message. (So I changed the account back to a Standard user). I have tried googling the error but I only find references to problems related to extension/add-in products to XCode: none of which have I added to my XCode installation. I am attaching screenshots of the steps through the project creation process. Hopefully someone can tell me what I am doing wrong or what the problem is. Thank you.
0
0
308
Mar ’25
Fetch Changes not working Xcode 16.2
I have cloned a private repo from GitHub and for the most part it seems to be working fine. e.g. commit, push and pull are working. However, Fetch Changes doesn't seem to work at all. It pops up a brief message as if it is working, but the status of my local branch under the Source Control Navigator -> Repositories does not get updated. Even after a push, the status still tells me I am ahead on the local branch. If I add a new file on the GitHub website, Fetch Changes will not see it and the repository status remains unchanged. All of these changes are immediately visible in 'Fork' (3rd party Git GUI). If I restart Xcode the status is updated correctly, but it does not keep up with further changes. Anything I can do other than avoid using Xcode for GitHub tasks? Update: This might just be a problem with the Source Control Navigator views not updating. I just found that if I change branch, the "Repositories" section will not reflect the branch change until I exit and re-enter that view. e.g. click on "Changes" and back into "Repositores" to see the update. That workaround does not impact the out of date repo status though (how many commits am I ahead or behind). Seems very buggy...
0
2
334
Jan ’25
Shared dependencies between test and production code creates library duplication
When test support code relies on production code, a diamond can occur. If this occurs across packages, it can lead to duplicated symbols and incorrect behavior at runtime despite no warnings at build time. This only occurs in Xcode and top-level application testing. This doesn't occur when the code being tested is in a separate package. I'm trying to understand how to correctly manage shared test support code which needs to access production code, or if this is the correct way and it is an Xcode bug. For a minimized example project, see https://github.com/rnapier/SupportCode. The setup includes three packages: Dependencies, which manages all the dependencies for the app and tests; Core which contains core logic and test support; and Feature, which relies on Core an contains feature-related logic and test support. Building this system causes Core.framework to show up three times in DerivedData: ./App.app/PlugIns/AppTests.xctest/Frameworks/Core_59974D35D_PackageProduct.framework ./App.app/Frameworks/Core_59974D35D_PackageProduct.framework ./PackageFrameworks/Core_59974D35D_PackageProduct.framework When unit tests are run, there is a collision on the symbol for Keychain: objc[48914]: Class _TtC8Keychain8Keychain is implemented in both /Users/ornapier/Library/Developer/Xcode/DerivedData/App-grdjljgevqofhqgflgtrqvhvbtej/Build/Products/Debug-iphonesimulator/PackageFrameworks/Core_59974D35D_PackageProduct.framework/Core_59974D35D_PackageProduct (0x100a98118) and /Users/ornapier/Library/Developer/CoreSimulator/Devices/216C441E-4AE5-45EC-8E52-FA42D8562365/data/Containers/Bundle/Application/7197F2F2-EB26-42FF-B7DB-67116159897D/App.app/PlugIns/AppTests.xctest/AppTests (0x1011002c0). One of the two will be used. Which one is undefined. This is not a benign warning. There are two distinct copies of _TtC8Keychain8Keychain and test cases will access one and the app will access a different one. This leads to mismatches when accessing static instances such as .shared. I believe this dependency graph should work, and it does work as long as the top-level testing system is a Swift module. But if it is the application, it builds successfully, but behaves incorrectly in subtle ways.
0
5
518
Feb ’25
launchd_sim and AppleSpell deadlock
I've got a 2019 Intel iMac running Sequoia 15.4.1 and Xcode 16.3. Every time I try to view a storyboard Xcode locks up and beachballs on me. It takes minutes to load the file. When I force-quit Xcode, the report that shows up has this as the reason: Processes reached dispatch thread soft limit (64): launchd_sim [96305] [unique pid 194673], launchd_sim [96260] [unique pid 194628] Deadlock: AppleSpell [1494] thread 0x1df0c4 DispatchQueue 313 -> AppleSpell [1494] thread 0x1df0c4 DispatchQueue 313 Deadlock: AppleSpell [1494] thread 0x1df114 DispatchQueue 86 -> AppleSpell [1494] thread 0x1df114 DispatchQueue 86 Blocked by Deadlock: 1 task - AppleSpell [1494] I'm wondering, why is AppleSpell trying to spell-check a plist file? Is there any way to tell AppleSpell to ignore a file?
0
0
68
Apr ’25
Xcode 16.3 C++ compiler makes binaries with corrupted memory.
I am creating an xcframework for a static library for iOS, but I am encountering a perplexing issue with Xcode 16.3. When I build an xcframework using C++ in one project and import it into another project, the application runs with corrupted memory. In the framework project, I use os_unfair_lock, but when attempting to lock, the app crashes due to a state error. This suggests that memory corruption is occurring. When the xcframework is built with Xcode 16.2, a proper binary is generated, and the app runs without any problems. Since I do not want to disclose the source code, I am trying to construct a minimal project that reproduces the issue, but so far I have not been successful. Fundamentally, I feel that the compiler in Xcode 16.3 cannot be trusted.
0
1
127
Apr ’25
Affiliate View Struct is probably hidden by Charts on iOS app
The problem is: As per screenshot below, one can only see the lineChart. I have another struct AffiliateView coded under this Chart: import SnapKit import Charts import DGCharts class AffiliateViewController: UIViewController { private lazy var chartView: LineChartView = { let chart = LineChartView() chart.noDataText = "No data available." chart.chartDescription.enabled = false chart.xAxis.labelPosition = .bottom chart.rightAxis.enabled = false chart.legend.enabled = true chart.backgroundColor = .lightGray // For debugging visibility return chart }() private lazy var containerView: UIView = { let view = UIView() view.backgroundColor = .white return view }() override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white // Add container view and chart view to the main view view.addSubview(containerView) view.addSubview(chartView) // Add SwiftUI View inside the container view let affiliateView = AffiliateView() let hostingController = UIHostingController(rootView: affiliateView) addChild(hostingController) containerView.addSubview(hostingController.view) hostingController.view.frame = containerView.bounds hostingController.didMove(toParent: self) layout() setupChartData() } private func layout() { // Layout the container view (SwiftUI content) containerView.snp.makeConstraints { make in make.top.equalTo(view.safeAreaLayoutGuide.snp.top) make.left.right.equalToSuperview() make.height.equalTo(350) // Increase the height for the SwiftUI content } // Layout the chart view below the container view chartView.snp.makeConstraints { make in make.top.equalTo(containerView.snp.bottom).offset(20) // Space between chart and the affiliate content make.left.equalToSuperview().offset(20) make.right.equalToSuperview().offset(-20) make.height.equalTo(200) // Set a fixed height for the chart } } private func setupChartData() { let dataEntries = [ ChartDataEntry(x: 1, y: 10), ChartDataEntry(x: 2, y: 20), ChartDataEntry(x: 3, y: 15), ChartDataEntry(x: 4, y: 30), ChartDataEntry(x: 5, y: 25) ] let dataSet = LineChartDataSet(entries: dataEntries, label: "Clicks per Day") dataSet.colors = [.blue] dataSet.valueColors = [.black] dataSet.circleColors = [.red] dataSet.circleRadius = 4.0 let data = LineChartData(dataSet: dataSet) chartView.data = data chartView.notifyDataSetChanged() } } // SwiftUI View remains in the same file struct AffiliateView: View { @State private var customMessage: String = "" @State private var uniqueLink: String = "Your unique link will appear here." @State private var clickData: [Double] = [10, 20, 15, 30, 25] // Example data var body: some View { NavigationView { VStack(spacing: 20) { // TextField for custom message input TextField("Enter your custom message...", text: $customMessage) .textFieldStyle(RoundedBorderTextFieldStyle()) .padding(.horizontal) // Generate Link Button Button(action: generateLink) { Text("Generate Sign-Up Link") .font(.headline) .foregroundColor(.white) .frame(maxWidth: .infinity, maxHeight: 50) .background(Color.red) .cornerRadius(10) } .padding(.horizontal) // Generated Link Label Text(uniqueLink) .font(.body) .multilineTextAlignment(.center) .padding(.horizontal) // You can add a chart here if you want to show it in SwiftUI too /* LineChartView(data: clickData, title: "Clicks per Day", legend: "Daily Clicks") */ } .navigationTitle("Affiliate Marketing") .navigationBarTitleDisplayMode(.inline) } } private func generateLink() { let encodedMessage = customMessage.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? "" uniqueLink = "https://affiliate.example.com/referral?message=\(encodedMessage)" addClickData() } private func addClickData() { clickData.append(Double.random(in: 0...100)) } } As you see, the AffiliateView has been declared outside of Controller View class. The View content was visible before the lineChart was added into this code. Now the View content is not visible anymore. I have tried to increment/decrement values at make.height.equalTo() but to no avail. Could anyone kindly point me in the right direction?
0
0
318
Jan ’25
iOS 18.4で NFC や FeliCa の読み取りがしずらい状況のようです。こちらは認知されていますでしょうか?どのバージョンで直る想定でしょうか?
■概要: 弊社で開発しているアプリ内には、モバイルSuicaを読み取る機能があるのですが、iOS18.4でSuicaの読み取りができない事象に遭遇しています。(ごくまれに読み取れるときがある) ■利用API CoreNFC ■聞きたいこと: こちらいつごろ修正されるか教えてください。 ■参考情報 他社様ですが類似だと思われる事象が発生しております。
0
0
129
Apr ’25
Xcode completion binding not working in 16.2
I'm wondering why 'Select Previous Completion' and 'Select Next Completion' aren't working. I'm using Ctrl-K and Ctrl-J but only my arrow keys work to navigation the completion list. 'Show Completion List' works just fine with Ctrl-Esc. There are no conflicts with any Xcode bindings, and I've checked my system settings for keyboard shortcuts as well.. I've completely disabled copilot, etc.. Is there another setting I'm missing? Or, is this a known issue?
0
0
31
Apr ’25
Bonjour Capabilities
I'm a noobie but doing a tutorial where it requires me to add these capabilities to my project. Access Wi-Fi Information Network Extentions Bonjour Services I have the Access Wi-Fi and Network Extentions installed but I could not find Bonjour Services Any help would be much appreciated! Thanks
0
0
147
Jan ’25
How to exclude header files from 3rd party pods from getting the Apple Clang warning policies?
I have the 'warnings as errors' policy set to Yes for Apple Clang and Swift compiler. As far as I know, there is no way to make exceptions to the warning policies from Swift compiler (correct me if I am wrong), what about Clang warning policies, specifically when it comes to header files from 3rd party pods? They don't show up on the Compile Sources so I can't apply flags such as -Wno-error=deprecated to them. Adding #pragma GCC... to them won't help as a fresh pod install will wipe the #pragma statements out. Is there a way to exclude the header files from pods from getting the warning policies from Clang so I won't see errors from them when compiling Clang modules that's a part of the build process?
0
0
307
Feb ’25
How to Handle Identically Named Files in Different Folders in Xcode 16
Hello everyone =) I'm working at the moment on a project in Xcode 16 where I need to have multiple files with the exact same name, stored in different folders (for example, separate quest data files). When I compile, Xcode seems to treat these identically named files as duplicates, causing build errors. How can I properly organize (or configure) Xcode so that it recognizes these files as distinct? Any advice or best practices would be greatly appreciated. Thank you! ;)
0
0
247
Dec ’24
App crashing on real iPhone only (working fine on simulator and Xcode preview)
Hi, I'm currently facing an issue where my React Native app crashes only on a real iPhone. On the simulator and in Xcode preview, the app runs fine. Previously, I had an issue with FlatList regarding props.getItem, which I solved by installing some missing Babel dependencies. After that, everything worked correctly in the simulator. But when I try to open the app on a real device, it shows the splash screen and crashes immediately. I've already done a full clean and reset, including: npx react-native start --reset-cache Deleted node_modules and Pods, reinstalled everything Cleaned build folder via Xcode Deleted DerivedData Restarted Metro bundler and simulator/device The issue only happens on the physical device. Here’s a portion of the crash log IDate/Time: 2025-04-14 19:11:28.6796 -0300 Launch Time: 2025-04-14 19:11:28.5292 -0300 OS Version: iPhone OS 18.3.2 (22D82) Release Type: User Baseband Version: 4.20.03 Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: JazminChebar [1973] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x19a0865fc __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x197601244 objc_exception_throw + 88 (objc-exception.mm:356) 2 JazminChebar 0x1009b2c04 RCTFatal + 568 (RCTAssert.m:147) 3 JazminChebar 0x1009c81f8 __28-[RCTCxxBridge handleError:]_block_invoke + 532 (RCTCxxBridge.mm:1178) 4 libdispatch.dylib 0x1a1e19248 _dispatch_call_block_and_release + 32 (init.c:1549) 5 libdispatch.dylib 0x1a1e1afa8 _dispatch_client_callout + 20 (object.m:576) 6 libdispatch.dylib 0x1a1e29a34 _dispatch_main_queue_drain + 984 (queue.c:8093) 7 libdispatch.dylib 0x1a1e2964c _dispatch_main_queue_callback_4CF + 44 (queue.c:8253) 8 CoreFoundation 0x19a0d2bcc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1793) 9 CoreFoundation 0x19a0cf1c0 __CFRunLoopRun + 1996 (CFRunLoop.c:3163) 10 CoreFoundation 0x19a121284 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 11 GraphicsServices 0x1e73914c0 GSEventRunModal + 164 (GSEvent.c:2196) 12 UIKitCore 0x19cc6a674 -[UIApplication _run] + 816 (UIApplication.m:3846) 13 UIKitCore 0x19c890e88 UIApplicationMain + 340 (UIApplication.m:5503) 14 JazminChebar 0x100178708 main + 80 (main.m:7) 15 dyld 0x1c037dde8 start + 2724 (dyldMain.cpp:1338)
0
0
65
Apr ’25
Unity (IL2CPP) iOS Build: "_placeGeoAnchor" Undefined Symbol for Architecture arm64
Hi all, I’m running into a persistent linker error when building my Unity 6 project (IL2CPP, iOS target) that calls a Swift method via an Objective-C++ wrapper. Despite following all known steps, I keep getting: Undefined symbols for architecture arm64: "_placeGeoAnchor", referenced from: _GeoAnchorTrigger_placeGeoAnchor in libGameAssembly.a ... ld: symbol(s) not found for architecture arm64 I’m trying to place a persistent AR anchor at real-world GPS coordinates (so that the same asset can appear at the same location for a returning user). Since I’m targeting iOS, I can’t use Google’s geospatial anchors (but I sooo wish I could--please apple I beg of you stop being so selfish lol). I've already done these things: Swift file is added to Unity-iPhone target. .mm and .h files are in Unity-iPhone target under Compile Sources. Bridging header is set to Unity-iPhone-Bridging-Header.h. Generated header name is correct (GeoTest-Swift.h). Build Active Architecture Only set to No. Function has attribute((visibility("default"))). Unity project uses IL2CPP scripting backend. Yet I'm still getting the same linker error — it appears Unity (via IL2CPP) references the function, but Xcode doesn't link it. It’s something small that’s being missed with how IL2CPP links native symbols? Or maybe I need to explicitly include something in Link Binary With Libraries? I’ve verified symbol visibility and targets repeatedly. I’ve built AR features in Unity before (for Quest), but this is my first time trying to bridge C# → Objective-C++ → Swift in this way for a geolocation-based AR anchor for an iphone. I'm going crazy, I’ve been stuck on this for 12+ hours now, so any insight or nudge would be deeply appreciated. SPECS: Macbook Pro M4 Pro--Sequoia 15.4 Unity 6000.0.45f1 IPhone 11 iOS 18.4 Xcode 15
0
0
154
Apr ’25
Apple developer
in xcode i have select the developer team. but show some error that is here, "Communication with Apple failed Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/" and show this error also "No profiles for 'com.kuntaldoshi.homeautomation' were found Xcode couldn't find any iOS App Development provisioning profiles matching 'com.kuntaldoshi.homeautomation'."
0
0
359
Feb ’25