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

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
1.9k
May ’24
[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?
0
0
18
1h
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
29
3h
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.
0
0
25
6h
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
0
0
38
9h
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.
0
0
28
7h
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
28
6h
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
77
22h
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
64
1d
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
68
2d
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
48
2d
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
62
22h
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
60
2d
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
60
2d
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
61
2d
Crashing in WKWebview Often, when the video is loaded in the webview using an HTML file
Hello, Team. We used WKWebView for our project. We loaded the HTML file into the webview and added the following configuration. weak var webView: WKWebView! func configWebView() { let webViewConfig = WKWebViewConfiguration() let controller = WKUserContentController() controller.add(self, name: "sometest") webViewConfig.userContentController = controller webViewConfig.processPool = WKProcessPool() webViewConfig.setValue(true, forKey: "allowUniversalAccessFromFileURLs") webViewConfig.mediaTypesRequiringUserActionForPlayback = [] let webpagePreferences = WKWebpagePreferences() webpagePreferences.allowsContentJavaScript = true webViewConfig.defaultWebpagePreferences = webpagePreferences webViewConfig.websiteDataStore = WKWebsiteDataStore.default() webView = WKWebView(frame: .zero, configuration: webViewConfig) webView.navigationDelegate = self webView.uiDelegate = self webView.translatesAutoresizingMaskIntoConstraints = false view.addSubview(webView) NSLayoutConstraint.activate([ webView.topAnchor.constraint(equalTo: view.topAnchor), webView.bottomAnchor.constraint(equalTo: view.bottomAnchor), webView.leadingAnchor.constraint(equalTo: view.leadingAnchor), webView.trailingAnchor.constraint(equalTo: view.trailingAnchor) ]) loadWebView() } func loadWebView() { guard let documentsDirectoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return } let contentFolderURL = documentsDirectoryURL.appendingPathComponent("content") let assetFolderURL = contentFolderURL.appendingPathComponent(interactiveGUID) if FileManager.default.fileExists(atPath: assetFolderURL.path) { let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! let documentsURL = URL(fileURLWithPath: documentsPath) let fileToLoadPath = (documentsPath as NSString).appendingPathComponent("content/index_p.html") let fileURL = URL(fileURLWithPath: fileToLoadPath) autoreleasepool { DispatchQueue.main.async { [weak self] in guard let self = self else { return } self.webView.loadFileURL(fileURL, allowingReadAccessTo: documentsURL) } } } We are experiencing webview crashes when loading an HTML file. What happened when I loaded the video file? It automatically looped. Webview frequently crashes when the HTM/JS file is loaded. When a webview crashes, the delegate method usually calls webViewWebContentProcessDidTerminate. This method calls webview.reload(). Also we are clear and cache/ deallocate eveything when i initialized those configuration mentioned as the above. Can you suggest a solution to this? Why is webview crashing? Thank you.
0
0
58
2d
Can't compile asset catalog when including iMessage App Icon asset
I'm trying to add an iMessage extension to my app, and upon adding the iMessage App Icon set, I ran into an issue with one specific icon size: 1024x768px, aka 1x 1024x768pt. When I remove this one icon from the icon set, it compiles and runs fine, however I can't push it to the App Store as I get the error: "Asset validation failed. Missing Image Asset. Your app is missing the Large App Icon asset 'AppIcon' in 'Payload/Runner.app/PlugIns/MessagesExtension.appex'." I'm assuming this refers to 1024x768px, as this size placeholder appears upon adding a New Messages Extension Icon to my assets folder, and 1024x1024 is already included and compiles fine with it. However, when I add the 1024x768 icon, and try to run the app, I get the error: "Command CompileAssetCatalog failed with a nonzero exit code" The app icon's filename is correct, it is exactly 1024x768 px, and my contents.json correctly includes : { "filename" : "AppIcon_1024x768.png", "idiom" : "ios-marketing", "platform" : "ios", "scale" : "1x", "size" : "1024x768" } as is the same format for all of my other icons that work. Why am I running into this issue upon inclusion of this one required size? How do I fix it?
1
0
105
3d