Posts under Developer Tools & Services topic

Post

Replies

Boosts

Views

Activity

Struggling to add a test target to an existing project in Xcode
Sorry if this question is too vague, however I've tried this multiple times and see the same result. I'm pretty sure I'm doing something wrong, but don't know what. I have a Multiplatform (iOS and macOS) project that builds, and runs I add a new target of type Unit Test Bundle I click the diamond in the margin beside the XCTestCase declaration at the top of the new Test file The target project builds, then Xcode says 'Testing...' and it stays like this forever. I've also tried creating a new scheme that targets the target created in the above steps. attempting to run my tests behaves the same. The top status bar will get stuck saying 'Testing...' and never get anywhere. I'm pretty sure this is something basic. thanks, in advance for any guidance. Mike
2
0
1.3k
Nov ’24
Moving files to local package not possible in Xcode 16?
Hi! Trying to move some code into a local package - with Xcode 16 I am unable to move my code to the new package as drag and drop will always result in a copy. This contradicts the demo in the original intro session at WWDC19, and also the current documentation.. Of course I can delete the original files but this feels somewhat wrong... Am I missing something? Did the behaviour of moving files in the Project navigator change in the recent Xcode releases?
0
0
308
Dec ’24
Xcode 16: AppLaunchTimeoutError: Failed to launch app in reasonable time
Xcode Version: 16 MacOS Version: 15.0 My app has 2 packages: Firebase iOS SDK (https://github.com/firebase/firebase-ios-sdk.git) Google Mobile Ads (https://github.com/googleads/swift-package-manager-google-mobile-ads.git) My app fails to run on the Xcode Preview window. The app works successfully on a simulator when built. But, not in the Xcode Preview. I have tried: Cleaning and rebuilding. Changing the target device. Resetting Package Cache There are no solutions mentioned/provided online. I have a previews-diagnostics zip file ready. Who can I share it with?
0
0
273
Nov ’24
Does 'swift build' execute Test Code on macOS even for iOS Only Apps?
Hi, I have a library for my iOS Apps. It uses among other things the Combine framework, Core Location and OSLog. I manage the library using the Swift Package Manager (SPM) and usually build via XCode, which works fine. However for CI I would like to build everything from the terminal. So I do call 'swift build' on the terminal. This produces errors such as: 'PassthroughSubject' is only available in macOS 10.15 or newer 'os_log(:dso:log::_:)' is only available in macOS 10.14 or newer 'eraseToAnyPublisher()' is only available in macOS 10.15 or newer 'authorizedWhenInUse' is unavailable in macOS 'AnyPublisher' is only available in macOS 10.15 or newer 'showsBackgroundLocationIndicator' is unavailable in macOS ... These are all from the used frameworks. However, I do not care on which version of macOS, for example, PassthroughSubject is only available at, since the library is iOS only. Too make sure of that I added "platforms: [.iOS(.v14)]" to my Package.swift and thought this would be sufficient, so the project does not get build for macOS. Can anyone please tell me or give me a hint on what I am getting wrong here?
0
0
263
Nov ’24
Why can't I enable Weatherkit?
Specifically, In (https://developer.apple.com/account/resources/identifiers/): I can't find the Weatherkit option under Capabilities or App Services in the configuration of the identifier. In Xcode: Add WeatherKit capability fail. output log: The capability associated with "WEATHERKIT" could not be determined. Please file a bug report at https://feedbackassistant.apple.com and include the Update Signing report from the Report navigator. Is it related to my region and account? My account is Apple Developer Enterprise Program , the region is Mainland China.
2
0
1.2k
Dec ’24
Hi, I have an issue with app preview
I can't seem to access preview for any of my views in any of my swift projects at all (using Mac to code and using iPhone 16 pro as preview and simulation, simulation can work), even after restarting Mac and Xcode itself. The preview section has a popup saying "Cannot preview in this file, unexpected error occured" (for every file), please tell me what is wrong and help me solve it to see the preview, thank you! details
1
0
551
Nov ’24
ExternalLinkAccount API
I am having a very strange problem with await ExternalLinkAccount.canOpen On some apps using the same project and code (different targets) it reports false, but works in the simulator. Some apps work both in the simulator and a device and, but some apps only work in the simulator. They are all sharing the same code. What could be wrong? They all have SKExternalLinkAccount and the correct url in plist and they also have the com.apple.developer.storekit.external-link.account entitlement
1
0
250
Dec ’24
Can Xcode still link with libcurl.{#}.tbd?
I created a new iOS project (storyboard if it matters) and added a bunch of C files to it. Some portion of the C files depend on libcurl. I would like to be able to build for both simulator and device if possible. Google claims that Xcode can provide the dependency as part of the inbuilt libraries however I do not see libcurl.4.tbd (or any version) as an option to choose. Is this feature no longer available or is there something I am missing here? For context here is a screen shot of my build error situation
4
0
561
Dec ’24
Looking for WebKitSupportLibrary.zip for archival
It was required to compile older WebKit versions for other operating systems and was made available up until ~2020 by Apple under the url http://developer.apple.com/opensource/internet/webkit_sptlib_agree.html However this site and file does not seem to be available anymore. Looking for someone who can provide this file. I'd like to put this on archive.org for historic purposes.
0
0
235
Nov ’24
Different optimization level for package dependencies
I am using DuckDB as an external dependency in my project. The package is basically a Swift wrapper around C++ code. If I run my app in Debug mode, then the performance of the library is an order of magnitude slower than when I run it in Release mode. In Release mode it is really fast, but compilation times are too slow. I am a complete beginner to Xcode's build system and was wondering if there was any way to have the best of both worlds? For example, by compiling my SwiftUI code without optimizations but having it linked to a static and optimized version of the library.
0
0
418
Nov ’24
EXC_BAD_ACCESS KERN_INVALID_ADDRESS ,Crashed: com.apple.main-thread
I am experiencing a crash on iOS 18 for some devices when the app becomes active again after being inactive for one or two days, with the following details: Crash Information: Thread: com.apple.main-thread Exception: EXC_BAD_ACCESS KERN_INVALID_ADDRESS The crash occurs intermittently on certain devices, but I haven’t been able to reproduce it consistently. Based on the crash logs, it seems to be related to accessing an invalid or corrupted memory address. But if user try to uninstall the app or restart the device, the issue is gone . Is this a known issue in iOS 18? Are there any official workarounds or fixes? Could this be related to specific device configurations, such as limited memory on older models? Are there any known APIs or frameworks in iOS 18 that could trigger such an issue? What additional debugging steps would you recommend to narrow down the root cause? Have other developers encountered similar crashes in iOS 18? Thank you for your help! I appreciate any insights or suggestions.
1
0
670
Dec ’24