I have a small Swift command line tool for MacOS.
I have added a small demo CoreML model to the project and can correctly load the model in Swift like let model = try! Matcher_512x256().
However, once I add a single C++ or Objective C file to the Compile Sources of my build target, the compilation fails with an error stating that the model cannot be found: "...ModelAndCpp/ModelAndCpp/main.swift:11:18 Cannot find 'Matcher_512x256' in scope".
Please help me resolve this. Does XCode change into a different "compilation mode" once a C++ file is present which might cause this error? XCode version is 16A242d.
I can reproduce the issue with a tiny repository (5 small files) which I have uploaded here on GitHub.
To reproduce the issue, simply remove the .m and .cpp files from Compile Sources to compile correctly, or add one of them to get the error.
Thank you and best regards,
Manuel
Xcode
RSS for tagBuild, 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
When requiring some components from the SwiftUI framework, Xcode 16.0 recommends importing SwiftUICore in its quick fix error suggestions. Previously, SwiftUI would be suggested.
What is the difference between the two and which is the recommended one for importing?
Can Xcode15 compile on an iPhone of iOS18?I want to update my iPhone to iOS18, but I do not want to update my Xcode.
Hello!
I have been successfully building out my Xcode project in the past few months to my iPhone 15. I recently got a new iPhone 16 pro and have been having a hell of a time trying to figure out how to build to my new phone.
Here's the error I am getting:
Unknown file type in '/Users/username/Desktop/filename/Libraries/libiPhone-lib.a'
please help! Any suggestions would be greatly appreciated.
NOTE: I am using a M1 laptop with Sequoia OS
When I copy and paste example code in apple developer documentation, LongPressGesture does not work as expected in Xcode Version 16.0 (16A242) and iOS 18. It seems updating(_:body:) method does not work when used with LongPressGesture. When I make a breakpoint in updating(_:body:) method and long press the blue circle on the screen of simulator(or device), it is expected to be caught in breakpoint or it is expected that color of circle turns from blue to red to green. However, it is not caught in breakpoint and never turns to red.
Question of Stackoverflow is about same issue and I can not use onLongPressGesture method to implement required feature of my app.
I submitted bug report via Feedback Assistant and my report's ID is FB15127375 and FB15173175. Please tell me if there is any investigation about this issue.
Development environment: Xcode Version 16.0 (16A242), macOS 14.5
Run-time configuration: iOS 18.0
"Can not preview in this file"
Xcode 16.0
iPhone 14 Pro , iOS 18.0
When I choose to start Preview on my iPhone, the canvas screen keeps showing loading circle animation. The iPhone enters the Xcode Previews App but only displays the default screen (Xcode icon& 'Preview from Xcode')
I uploaded the some of diagnostics files
previews_diagnostics_summary.txt
remote_injection.json
In Xcode 16 and Xcode 16.1 beta 2 the lazy loading of list does not work properly. Tested on physical device with iOS 17.
Below is minimal code to reproduce this issue:
You can see in the debug console how many child views are initialized based on the print statement.
import SwiftUI
@main
struct TestDemoApp: App {
let data = Array(1...1000)
var body: some Scene {
WindowGroup {
List(data, id: \.self) { item in
SomeView(item: item)
}
}
}
}
struct SomeView: View {
static var count = 0
let item: Int
init(item: Int){
self.item = item
Self.count += 1
print(Self.count)
}
var body: some View{
Text(String(item))
.frame(height: 100)
}
}
When the view is shown the List creates all child views at once as shown in the console output:
It does not loads only first 13 out of 1000 as it does in older xcode 15.2:
As the List is quite often used component in Swiftui Apps, the apps will be slow, because all the data are loaded and the main thread will be stuck until all child views are loaded.
Hello everyone! I’m new to this forum and have never designed an app before. I’ve used Unity and Xcode. When I launch the build in Xcode, it always replies “Build Failed.” I’ll explain the problem and attach some screenshots.
The app I’m trying to launch comes from the Unity platform (version 2022.3.46f1) + Vuforia for augmented reality. Everything works well on this platform (I’ve already checked it); I export the project into a specially created folder after clicking on “Build”; I open the project in Xcode version 16.0 (I downloaded this application a few days ago); I connect my iPhone and my Apple ID by going to “Xcode” > “Settings” and linking my account; to connect my iPhone, I go to “Window” > “Devices and Simulators” and link everything; then I go to “Targets” > “Unity iPhone” and check in the “General” and “Signing and Capabilities” sections to ensure everything is correct; I then change the development team name to my account “MARCO ARICO” (previously activated on Apple Developer with an already paid annual subscription) and check that the “Bundle Identifier” is the same as the one I entered in Unity under “Player” > “Other Settings.” At this point, I send the Build, and after a few moments, it says “Build Failed” with this error: “/Users/albertodanielemanzo/Desktop/Unity/App_7/Unity-iPhone.xcodeproj Signing for 'Unity-iPhone' requires a development team. Select a development team in the Signing & Capabilities editor.” I would like to add that the Mac I’m using belongs to a friend who specifically lent it to me to launch this app, and all the steps I took are based on in-depth research from YouTube tutorials and official Unity and Xcode forums.
The computer I’m using is a MacBook Air with macOS Sonoma 14.6.1, which belongs to my friend who lent it to me. All subscriptions are under my name. My username is the same as the development team name (Development Team); the subscription I have with Apple is individual, as are my downloaded certificates for app development.
I have already addressed the issue with Apple Developer support, and they advised me to write on this forum.
I have enabled an App Group in my App and the Widget Extension. I use it to share my UserDefaults. Every time the app starts I now get the following error message in the Xcode console:
Couldn't read values in CFPrefsPlistSource<0x303034510> (Domain: group.XX.XXXX.XXXX, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
The shared UserDefaults itself works without problems.
Any ideas how I could get rid of this warning?
Hello, when I use xcode 16 build swift xcframeworks and provide it for my customer, however they can not use it their xcode 15 projects.
Undefined symbol: _swift_FORCE_LOAD$_swift_Builtin_float
Undefined symbol: _+ _swift_FORCE_LOAD$_swift_errno
Undefined symbol: _+ _swift_FORCE_LOAD$_swift_math
Undefined symbol: _+ _swift_FORCE_LOAD$_swift_signal
Undefined symbol: _+ _swift_FORCE_LOAD$_swift_stdio
Undefined symbol: _+ _swift_FORCE_LOAD$_swift_time
Undefined symbol: _+ _swift_FORCE_LOAD$_swiftsys_time
Undefined symbol: _+ _swift_FORCE_LOAD$_swiftunistd
What should I do?
And macOS Sequoia does not support Xcode 15.4. I can not build my frameworks with Xcode 15.4 now.
Hi everyone,
I’m having trouble getting my iPhone 11 to detect a DWM3001CDK as an accessory using the Apple Nearby Interaction app. Here’s the background:
Two years ago, I successfully tested UWB ranging between the same devices (iPhone 11 and DWM3001CDK, which is based on the Qorvo DW3110 IC and an nRF52833 SoC with Bluetooth 5.2). At that time, the Nearby Interaction app was in beta and worked well for my tests. Now, with the stable version of the app, I’m encountering an issue.
Here’s what I’ve done so far:
I erased the DWM3001C and flashed it with the Qorvo Nearby Interaction firmware (v3.2.0, "DWM3001CDK-QANI-FreeRTOS_full_QNI_3_0_0.hex") using J-Flash Lite V7.86g on Windows.
With this configuration, I can connect the iPhone 11 to the accessory using the Qorvo NI apps, both in the foreground and background.
However, when I compile and run the project "ImplementingSpatialInteractionsWithThirdPartyAccessories" (available on the Apple Developer website) on my iPhone 11 (running iOS 17.7), the app remains stuck on the "Scanning for accessory" screen and doesn’t find the device, even though I’ve given the app permission to use Bluetooth.
Could this be due to an issue with the firmware I flashed on the DWM3001CDK, or might there be something else causing the problem?
Any help or insights would be appreciated!
Thanks in advance.
Buongiorno a tutti! Sono nuovo su questo Forum e non ho mai progettato una app prima d'ora. Ho usato Unity e Xcode. Su Xcode lancio la build, ma mi replica sempre "Build Failed". Adesso spiego il problema e allego degli screen.
L'app che sto cercando di lanciare viene dalla piattaforma Unity (versione 2022.3.46f1)+Vuforia per realtà aumentata. Su questa piattaforma funziona tutto (ho già avuto modo di ricontrollare); esporto il progetto nella cartella appositamente creata dopo aver cliccato su "Build"; apro il progetto su Xcode versione 16.0 (questa applicazione l'ho scaricata qualche giorno fa); collego il mio iPhone e il mio ID Apple andando su "Xcode" > "Settings" e collego il mio account; per collegare il mio iPhone vado su "Window" > "Devices and Simulators" e collego il tutto; dopodichè vado su "Targets" > "Unity iPhone" e controllo nelle sezioni "General" e "Signing and Capabilities" che tutto vada bene; modifico quindi il nome del team di sviluppo e metto il mio account "MARCO ARICO" (preventivamente attivato su Apple Developer con abbonamento annuale già pagato) e controllo che il "Bundle Identifier" sia lo stesso che ho inserito su Unity nella sezione "Player" > "Other Settings"; a questo punto mando la Build e mi dice dopo pochi istanti "Build Failed" con questo errore: "/Users/albertodanielemanzo/Desktop/Unity/App_7/Unity-iPhone.xcodeproj Signing for "Unity-iPhone" requires a development team. Select a development team in the Signing & Capabilities editor."
Mi permetto di aggiungere che il Mac che sto usando è di un mio amico che me l'ha appositamente prestato per lanciare questa app e che tutti i passaggi che ho fatto sono frutto di approfondimento su tutorial YouTube e forum ufficiali di Unity e Xcode.
Il pc che sto usando è un MacBook Air con macOS Sonoma 14.6.1 di un mio amico che me lo ha prestato. Tutti gli abbonamenti li ho fatti a nome mio. Il mio nome utente è lo stesso nome del team di sviluppo (Developement Team); l'abbonamento che ho stretto con Apple è di tipo individuale come sono miei i certificati scaricati per lo sviluppo dell'app.
Ho già affrontato il problema con l'assistenza telefonica di Apple Developer e mi hanno consigliato di scrivere su questo Forum.
Hello: I have Xcode running and I have already downloaded the Vision Pro simulator, but it doesn't open. It even appears open within the Xcode application as an internal window and it works... but it doesn't allow me to open the simulator app. I need help, please. I'll leave a couple of pictures below that explain it better.
When testing on Xcode Cloud I am unable to use any simulators between iOS 16.2 and 17.5. I'm glad that there are options for <= 16.1, but given how small those userbases must be at this point it feels rather odd. Similarly, iOS 18 is still very new so it also has a disproportionately small number of users on it. Does not seem to matter if explicitly selecting Xcode/macOS versions.
Am I configuring something incorrectly? Picked something wrong on a dropdown, checked the wrong box when setting up the workflow?
Xcode 15.4 allows building to iOS 17.5, but not iOS 18. 🙃
I installed xcode 16 and both Predictive Code Completion Model and iOS 18.0 Simulator Failed Download.
I can live without the code completion, but I can not get any Simulator to install.
I clicked of the info button and it shows the following:
Download failed.
Domain: DVTDownloadableErrorDomain
Code: 41
User Info: {
DVTErrorCreationDateKey = "2024-09-30 15:57:24 +0000";
}
Download failed.
Domain: DVTDownloadableErrorDomain
Code: 41
Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({
RequestedBuild = 22A3351;
})
Domain: DVTDownloadsUtilitiesErrorDomain
Code: -1
Download failed as the server said authentication failed. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime)
Domain: com.apple.MobileAssetError.Download
Code: 41
User Info: {
checkServer = 1;
}
System Information
macOS Version 15.0 (Build 24A335)
Xcode 16.0 (23051) (Build 16A242d)
Timestamp: 2024-09-30T10:57:24-05:00
Hi there, I’m having issue with the python3 installation provided by Xcode’s toolchain. I’m currently writing a LLDB plugin, using the LLDB python API, to allow the user to visualize audio data from the current debugged program in a GUI, using tkinter and matplotlib. I'm using those because I'm developing a cross-platform plugin, as I'm initially a Linux developer who wants to make this available to my fellow Apple audio devs.
My issue arise at least on two setups
MacOS 12.7.6 Monterey with Xcode 14.2
MacOS 14 with Xcode 15.4 (not my machine)
Because I wanna support Xcode’s toolchain, I want to use Xcode’s lldb. Xcode’s lldb uses Xcode’s provided python, which I’m having issues with when loading tkinter.The issue can be reproduced like this :
> xcrun python3 -c "import tkinter;tkinter._test()"
macOS 12 (1207) or later required, have instead 12 (1206) !
zsh: abort xcrun python3 -c "import tkinter;tkinter._test()"
On MacOS 14 the version numbers are :
macOS 14 (1407) or later required, have instead 14 (1406) !
You can see it fails to load tkinter. From what I understood so far, it looks like the tkinter/tcl/tk version distributed with Xcode is not supported by MacOS ?I checked and the imported tkinter module is definitely the one provided by Xcode’s toolchain :
# Checking where tkinter is installed
> fd "^tkinter$" /Applications/Xcode.app
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/tkinter/
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/future/moves/tkinter/
# Checking that Xcode python uses the right module - it matches
> xcrun python3 -c "import tkinter;print(tkinter.sys.modules['tkinter'])"
<module 'tkinter' from '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py'>
I can get a working tkinter working by installing it using homebrew or macports, but I’m not able to use it with Xcode’s python installation. I tried overwriting sys.path to force Xcode’s python to import homebrew’s tkinter module, but it still loads Xcode’s tkinter .so.
In the crash report I can see it indeed loads tcl/tk 8.5 and loads _tkinter.cpython-39-darwin.so from Xcode. I could disable the SIP (System Integrity Protection) to force to load another version of the library, but that wouldn’t be something I can ask the users.
On the LLDB forum, they advise against using another python interpreter that the one provided by the toolchain. So is there a way to get the provided tkinter/tcl/tk installation to work ? If not I’m confused about why it’s provided in the first place.
Thanks a lot for your time and please tell me if you have any questions.
PS: if possible i'll post the head of the crash report in the comment of this post
For my app I was trying to write some tests to ensure the functionality of all features. As I am using Xcode 16.0 I thought I might use Swift testing which was newly introduced and replaces XCTest.
I created a new test target with Swift Testing and tried to run the first test, which was created automatically by the system.
struct FinancialTests {
@Test func testExample() async throws {
#expect(true)
}
}
Xcode is also showing the test diamond next to the function so I clicked on it to execute it. The app started to build and the build ended successfully. The the next step was testing. And after waiting for 10 minutes or so, no test was executed. First I thought maybe the test was not found, but in the test case overview all tests were shown:
The run only shows this:
Can someone help me to get this running.
Many thanks!
Hello,
we have distributed the build for "Breathegolf" app successfully from XCocde, but it did not appear in the Test Flight section of the "Breathegolf" app. We have also created an internal testing group for the app and added a tester in the group. In the Test flight section, the version 1.0.0 appeared for some times but after after refreshing, it showed "No Builds". Why this is happening? Please suggest a solution.
Breathegolf, App ID - 6720740834
iOS now has a pre-build closure optimization for launch, so how do I know if my app launches with a pre-build closure optimization?
In what way can I check that my application has a pre-built closure at startup?
I just finished updating my app to support the new screen sizes for the iPhone 16 series devices (iPhone16 Pro and iPhone 16 Pro Max). In testing the changes, I've come across what I hope is simply a bug in the Xcode 16 simulators. I don't have any actual devices (yet) that I can use to test.
In landscape mode, my app presents a "tab" on the right side of the screen that can be tapped to bring out another view. Activating the tab is based on capturing the screen coordinates from a "tap".
In Xcode 16, using the iPhone16 simulators on IOS 18, the area of the tab does not recognize that a tap has occurred. After hours of banging my head against my laptop, it dawned on me that the area of the screen that hosts the "tab" is in exactly the same location as "unavailable area" that represents the camera on the simulator. I have arrived at the assumption that the issue is that the simulator is treating the same space at the bottom of the device as it treats that reserved area at the top of the screen.
Has anyone else experienced this?
Is this a bug in the simulator or is this expected behavior on the iPhone 16 series devices?