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

App that runs fine under Xcode 15 does not work on Xcode 16.
When I upgraded to Sequoia 15.1, an app that worked fine under OS 14 stopped working. Out of 4 views on the main screen, only 1 is visible. Yet, if I click where another view should be, I get the expected action so the views are there, just not visible. Only I can't see where I am clicking! I had to upgrade to Xcode 16 to recompile the app and run it in Debug mode. When I do, I get the following: NSBundle file:///System/Library/PrivateFrameworks/MetalTools.framework/ principal class is nil because all fallbacks have failed. Can't find or decode disabled use cases. applicationSupportsSecureRestorableState FWIW - the only view that actually shows up is the last subview added to the main view.
1
0
215
1w
[cxx-interop] Avoid breaking changes after enabling Swift C++ interoperability in library
Hi all, Background: I am working as a library developer and would like to enable Swift C++ interoperability in our library. Our library supports both CocoaPods and SPM. Question: I would like to know whether it is possible to avoid breaking changes bring to the library users after enabling Swift C++ interoperability. In my experiment, all apps and packages depend on the library needs to enable interoperability in Xcode or package manage tools, otherwise the source code cannot be complied. I am wondering is there any ways to bypass this? For example, is there a way to only enable Swift C++ interoperability only in our libraries?
1
0
157
1w
macOS Sequoia: “App” would like to access data from other apps when launched from Xcode
Since updating to macOS Sequoia, I see this dialog every time I launch my SwiftUI macOS app from Xcode: Users who installed the app from the App Store don’t see it. And this didn’t happened in previous macOS versions. Could launching it from Xcode be triggering some extra access requirement? How can I stop this dialog from appearing every time I launch my app? It’s very disruptive to the debugging process.
0
0
120
1w
Discrepancy between Xcode Memory Report and Xcode Instruments Memory Profiler
Hi Apple Engineers, I am encountering an issue where the memory usage reported by the Xcode memory report and the Xcode Instruments memory profiler are not aligned. Specifically: Xcode Memory Report: After implementing autoreleasepool, URLSession reading a zip file, and moving the task inside DispatchQueue.global().async, the memory usage goes down from 900MB to 450MB, indicating a potential memory leak. Xcode Instruments Memory Profiler: The memory usage goes down from 900MB to 100MB, suggesting that the memory has been properly released and there is no significant memory leak. Could you please help me understand the discrepancy between these two tools and provide guidance on the appropriate way to interpret the memory usage in my application? Which result I should rely on it? I would greatly appreciate your insights and expertise on this matter. Thank you in advance for your assistance.
2
0
129
6d
Multiple dynamic libraries in a package under SPM
We are currently building an app in Swift, reusing an internal C++ backend used in other platforms ( Linux/Windows/Mac ). Current state of the project: App W - ( Swift App ) Package X - Swift Package Y.xcframework - Binary Target (ios-arm64 and ios-arm64-simulator) Z.framework Z - (C++ Backend as a library) Dynamic Library Headers - Library header files Frameworks (Folder) - Required .dylib’s for Z ( libA.dylib (Dependency of Z) [ 58 of them ] libB.dylib (Runtime dependency of python) [ 123 of them ] data - Supporting binary files for Z conf - Supporting configuration files, both text and binary. for Z python - Supporting .py scripts C.py D.py Z.framework ( C++ ) contains 182 Dynamic Libraries. Goal: Validate the app for distribution with the Apple Store validation tool. Learning when trying to solve the problem: A framework can contain only one dynamic library (e.g. .dylib ) A framework cannot have nested frameworks within a Frameworks folder Certain file types within a framework are not treated as resource files (e.g. .py files) Possible solutions Allow to have nested Frameworks in Z.framework. It’s currently not allowed Link 182 dynamic libraries into the project via SPM Problem: Some of the libraries need to dynamically loaded at runtime (related to the python runtime) Making the libraries static adds significantly technical challenges to the Z.framework. Other questions: What’s the best way to achieve this
1
0
129
1w
App Store Connect, Developers Apple, xCode Teams Issue
I don't suppose anyone has encountered a weird discrepency between access to various teams across the different areas of Apple Development. I'm posting this here as it seemed the most suitable place. So, I've got an account and it has access to two different teams. This shows correctly for App Store Connect, I can switch between the teams using the dropdown and add new apps and the like. However, one of the teams is refusing to show up on developer.apple.com and in xCode for automated signing. I have Admin privilidges for the team at present and I can't figure out why it wouldn't show up in the account. I've tried removing the account and re-adding it to the team a few times to no avail. I'm just wondering if anyone else has encountered this issue and if so what's the cause and the solution. I've emailed Apple support about the issue but they seem rather slow to get back and just wondering if anyone could provide any insight here.
1
0
78
1w
VisionOS Simulator Stuck on Black Screen with "Hello World" Code in Xcode
Hello everyone, I’m currently developing my first VisionOS app in Xcode, starting with the default "Hello World" code provided when creating a new VisionOS Mixed Reality App. However, I’m facing some issues with performance and previewing that I can’t seem to resolve. When I load the preview, it takes an extremely long time, and sometimes it doesn’t load at all. Even when I try to run the app in the VisionOS Simulator, the simulator shows an endless black screen and never displays the intended view. I’ve made no changes to the code, so it’s purely the base setup. Here are my system details: Xcode version: 16.1, VisionOs 2.0; macOS version: 15.0.1; Hardware: MacBook Air 2020 M1 I’ve tried restarting Xcode and my machine, but the issue persists. Has anyone else faced similar problems or have any suggestions for fixing this? Or is my hardware simply too weak? Any help would be greatly appreciated! Thank you in advance!
1
0
95
1w
Validate fail Archive bundle is invalid Unable to load ‘Info.plist’ for bundle at path
This bundle is invalid. Unable to load ‘Info.plist’ for bundle at path: ‘My App.app/Contents/Library/Spotlight/MyApp-SpotlightIndex.mdimporter’.. This mdimporter is embedded in my app with a Copy step in Build Phases and when I Archive the compiled app, I get that error when I try to Validate. The app works OK, the mdimporter Spotlight works OK, all runs fine. But the Validate on the Archive does not work, it fails with that error.
1
0
137
2w
Crash calling UIHostingController from a Swift Package
Hello team, We recently found a EXC_BAD_ACCESS crash when using UIHostingControllers on a SPM local Package in our application. This is happening from time to time when we run the app on simulators using Debug configurations. Also, this issue is consistent when we run application tests, there is something weird that we found after making a research... If we disable app test target and only keep packages tests, the crash is not happening, but as soon as we re-enable the app test target from the test suite the crash returns. This is the full error message: Thread 1: EXC_BAD_ACCESS (code=1, address=0xbad4017) A bad access to memory terminated the process. Is this s known issue? We've been performing explorations for some days and couldn't find any real solution for this. A basic call on UIHostingController inside of a SPM local Package is enough to make the app crash, nothing custom being done: UIHostingController(rootView: MyView())
2
0
160
2w
When application merges libswift_concurrency.dylib is duplicated in app binary
Environment: Xcode 16.1 Swift version: 6.0.2 Inside of an Xcode project, if I declare a framework and an application. The framework is mergeable and the application merges the framework by configuring MERGE_BINARY_TYPE to Manual (or automatic it's independent). If SWIFT_VERSION is set to 6.0.X and deployment target is set to iOS 15< the build is going to fail because of this error Duplicate linked dylib '@rpath/libswift_Concurrency.dylib' in '/Users/**/Library/Developer/Xcode/DerivedData/GSPackage-dvnngsrgctfovgfbvwdlsscfycyq/Build/Products/Debug-iphonesimulator/DummyApp.app/DummyApp.debug.dylib' If I'm checking the generated artifact and inspect all of it's @rpath with otool it's giving me the following: otool -L /Users/****/Library/Developer/Xcode/DerivedData/Dummy-gbccsjwxeajftsafghxzaqksgfim/Build/Products/Debug-iphonesimulator/Dummy.app/Dummy.debug.dylib | grep @rpath @rpath/Dummy.debug.dylib (compatibility version 0.0.0, current version 0.0.0) @rpath/libswift_Concurrency.dylib (compatibility version 1.0.0, current version 0.0.0, weak) @rpath/libswift_Concurrency.dylib (compatibility version 1.0.0, current version 0.0.0, weak) A radar is already opened with the ID: FB15693702
0
0
124
2w
JitsiMeetSDK Build Issues: False Positive?
I received the follow error result and based on my research, it seems that it may be a false positive. Web3podium Version 1.0.8 Build 45 Please correct the following issues and upload a new binary to App Store Connect. ITMS-90338: Non-public API usage - The app references non-public selectors in Frameworks/JitsiMeetSDK.framework/JitsiMeetSDK: initWithURLStrings:. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/ ITMS-90683: Missing purpose string in Info.plist - Your app’s code references one or more APIs that access sensitive user data, or the app has one or more entitlements that permit such access. The Info.plist file for the “Runner.app” bundle should contain a NSPhotoLibraryUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. If you’re using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. For details, visit: https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources. This false positive perspective is based on looking to this issue online and looking at the existing Jitsi Meet implementations. We would appreciate guidance and direction for this pretty large and significant open source repository being leveraged. https://github.com/jitsi/jitsi-meet/issues/8624#issuecomment-781361671
0
0
109
2w
macOS App Archive Validation Failed mdimporter Info.plist
…How do I figure out what is wrong to be able to upload the app to the store with its signed mdimporter embedded? mdimporter in macOS project, compiled separately, signed and bundle dropped into Xcode app project. Runs fine but trying to upload to Apple App Store for macOS one runs an Xcode > Product > Archive command and I get this error… Xcode > Organizer > Products > Archives … Validation Failed Asset validation failed This bundle is invalid. Unable to load ‘Info.plist’ for bundle at path: ‘MyApp.app/Contents/Library/Spotlight/MyApp-SpotlightIndex.mdimporter’.. (UUID-shown-here) The Info.plist of the mdimporter is in the separate mdimporter Xcode project, the bundle is compiled as Build for Running and was dropped and copied into the Xcode app project. Runs fine. Any ideas on how to get that to NOT FAIL so I can succeed with my app Archive to upload to the Apple App Store? How to find out what is wrong? How to fix? I'm at a loss here.
1
0
113
2w
macOS Sequoia doesn't respect Full Disk Access for UITests-Runner
We develop and test App for macOS. We start to see system alert - "UlTests-Runner" would like to access data from other apps on each UITest run. Our test suite does cleanup of files generated by App so we need access outside of UITests-Runner sandbox. We enabled Full Disk Access for UITests-Runner at Settings -> Privacy & Security -> Full Disk Access but unfortunately still see this alert. Is there any way to permanently remove/hide this alert or remove sandbox for 'UITests-Runner' since we want to run tests on CI and having this alert is not an option? Note: everything works fine on previous versions of macOS. Environment: macOS - 15.1 (24B83) Xcode - Version 16.1 (16B40)
0
1
132
2w
Is it possible to include source code from an app extension in a framework?
If I have an XCode project that generates a framework when built, then I've noticed that its possible to add new additional targets to the project of type app extension. However if I add some source code to an app extension and regenerate the framework, then that source code is not accessable from the resulting framework (i.e. if the framework is included into an app, then the app code doesn't have visibility of the code that was added to the extension in the framework). Is this something which is possible to achieve? Ideally I would like to package the main source code that constitutes the framework content, along with the source code for a few extensions into a single framework, so that the app(s) that use the framework can include the framework into their main app target and also include it in the app extension target. I noticed that if the scheme of the framework is changed to the extension before building, then the result is not a .framework file but a .appex file. For client apps of the framework, can they directly include/use that .appex file? If so how can that be achieved? Does
1
0
108
2w
Is it possible to change the Xcode template type?
I've got a few years old app which was created using an Xcode template type of app. I'd like to split the model part of the code (model as in model-view-controller) out into a framework. Removed the view/controller source files to leave the model code is quick and easy, however the model code is large and complex with a couple of hundred of source files. Rather than create a new Xcode template type of framework and move the source files into there, is it possible to simply just change the template type of the existing project from app to framework?
1
0
98
2w