Dive into the vast array of tools and services available to developers.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

SwiftMacros Not able to access of main project XCTest File.
I have developed a Swift macro called @CodableInit in the SwiftCodableMacro module, and I’m able to use it successfully in my main project. Here’s an example usage: import SwiftCodableMacro @CodableInit // This is for Codable macros public class ErrorMonitoringWebPlugin { public var identifier: UUID = UUID() // MARK: - Codable required public init(from decoder:Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) identifier = try values.decode(UUID.self, forKey: .identifier) } } However, when I try to write a unit test for the ErrorMonitoringWebPlugin class, I encounter an issue. Here's the test case: func testCodableSubjectIdentifierShouldEqualDecodedSubjectIdentifier() { self.measure { let encoder = JSONEncoder() let data = try? encoder.encode(subject) //Here I am getting this error Class 'JSONEncoder' requires that 'ErrorMonitoringWebPlugin' conform to 'Encodable' let decoder = JSONDecoder() let decodedSubject = try? decoder.decode(ErrorMonitoringWebPlugin.self, from: data!) XCTAssertEqual(subject.identifier, decodedSubject?.identifier) } } The compiler throws an error saying: Class 'JSONEncoder' requires that 'ErrorMonitoringWebPlugin' conform to 'Encodable' Even though the @CodableInit macro is supposed to generate conformance, it seems that this macro-generated code is not visible or active inside the test target. How can I ensure that the @CodableInit macro (from SwiftCodableMacro) is correctly applied and recognized within the XCTest target of my main project?
0
0
49
Jun ’25
Issue with Custom Error Message on invalidate in CoreNFC APDU Tag Reader Session
Hi everyone, I'm working on an NFC-related app using CoreNFC with APDU commands to read and write tags. I’ve encountered an issue when trying to handle the scenario where the user cancels the NFC session. Here’s what’s happening: When a user cancels the NFC session manually (e.g., by tapping "Cancel"), I see an error log indicating tagReaderSession|userCancelled. However, when I explicitly call session.invalidate(errorMessage: "No NFC tag found") in my code to handle a scenario where no tag is detected, the session still shows the error as userCancelled instead of my custom error message. This behavior is confusing both in terms of debugging and for providing feedback to users, as I expect my custom message to appear instead of the generic "user cancelled" message. func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) { // Session becomes active } func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) { // Handle tag detection logic } func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) { print("Session invalidated with error: \(error.localizedDescription)") } func handleNoTagDetected(session: NFCTagReaderSession) { session.invalidate(errorMessage: "No NFC tag found") } I call handleNoTagDetected(session:) explicitly when no tag is detected, expecting the custom error message to show. However, the system still shows the cancellation error. Has anyone else experienced this behavior? Is this the intended behavior for CoreNFC, or am I missing something in my implementation? Any guidance would be appreciated. Thanks in advance!
0
0
375
Jan ’25
Unstable behavior of xcodebuild -showdestinations
Hi, I am having an issue with xcodebuild -showdestinations command. Steps to reproduce: Create a new iOS application project in Xcode or use an existing one. Navigate to this project in a terminal. Run xcodebuild -project 'your-project-name.xcodeproj' -scheme 'your-scheme' -showdestinations What I expect: All destinations available in the Xcode UI should be listed. What I get: It depends. For new projects, I consistently get only generic platform destinations and my connected physical device. When I run the same command on an older project, I sometimes see all the expected destinations. It seems to be a roughly 50/50 chance between the two outcomes. Is there a way to get consistent results from xcodebuild -showdestinations? What can I do to ensure all destinations are listed reliably? Here is a more detailed log and a screenshot: ❯ xcodebuild -workspace 'WorkoutDiary.xcworkspace' -scheme 'WorkoutDiary' -showdestinations Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace WorkoutDiary.xcworkspace -scheme WorkoutDiary -showdestinations User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES 2025-06-17 19:13:50.261 xcodebuild[34753:6177985] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. 2025-06-17 19:13:50.342 xcodebuild[34753:6177959] [MT] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. Resolve Package Graph Resolved source packages: <REDACTED> Available destinations for the "WorkoutDiary" scheme: { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:<REDACTED>, name:My Mac } { platform:iOS, arch:arm64, id:<REDACTED>, name:<REDACTED> } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } ❯ xcodebuild -workspace 'WorkoutDiary.xcworkspace' -scheme 'WorkoutDiary' -showdestinations Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace WorkoutDiary.xcworkspace -scheme WorkoutDiary -showdestinations User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES 2025-06-17 19:13:52.393 xcodebuild[34757:6178035] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. 2025-06-17 19:13:52.472 xcodebuild[34757:6178020] [MT] DVTDeviceOperation: Encountered a build number "" that is incompatible with DVTBuildVersion. Resolve Package Graph Resolved source packages: <REDACTED> Available destinations for the "WorkoutDiary" scheme: { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:<REDACTED>, name:My Mac } { platform:iOS, arch:arm64, id:<REDACTED>, name:<REDACTED> } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } { platform:iOS Simulator, id:DBFB9613-0261-4544-908A-335570F3C35F, OS:18.3.1, name:iPhone 11 } { platform:iOS Simulator, id:A48C309C-231A-4197-A295-900F89C94D86, OS:18.3.1, name:iPhone 16 Pro Max }
2
0
207
Jun ’25
Apple Developer certificate Revoke
I have received email about your development certificate has been revoked, but couldn't identify who did that, due to this revocation one of our enterprise application stopped working. So posting here to seek some suggestion on following 1.) Identification of Revoking Party: Though I have already raised a support ticket to Apple still waiting for their reply. Is it possible for Apple to send logs or account activity logs that from which account or who did the revocation? 2.) How much does Apple take to reply to the support tickets. 3.) No one else received email in my development team. Is it because the certificate which I created is revoked that's the reason only I have received email? 4.) May I know what are the other scenarios that certificate can be revoked other than a human error? 5.) Is there a way for us to internally monitor activity within our developer account, such as identifying who has been actively logged in and updating certificates?
0
0
373
Jan ’25
Not able to generate API key
After clicking the button I get an error message "An error occurred during generation. Reload this page to try again.", I tryed several times with same result. I saw in network tab the the request got 403 with error: { "errors" : [ { "id" : "a838db66-5e18-4dc8-8bb2-fc5903b41912", "status" : "403", "code" : "FORBIDDEN_ERROR.PLA_NOT_VALID", "title" : "Operation is forbidden because of PLA status.", "detail" : "" } ] } Anyone can tell me what is PLA status? Thank you
1
0
389
Nov ’24
Unable to link libxml2
Hi, I am encountering a linking issue with a project for an iOS .NET MAUI application that I am developing using Visual Studio 17.11.4. This project includes a custom static library (.a). The custom static library (.a) depends on the libxml2 library. However, it appears that libxml2 is not included in Xcode 15.4 (Sonoma OS), resulting in the following error: error : Undefined symbols for architecture arm64: error : "_xmlBufferCreate", referenced from: .... I have set the following additional arguments for compilation: -cxx -gcc_flags "-lz -lxml2". Despite my efforts to install libxml2 using Homebrew, I have not been successful. Could you please advise on how I can resolve this issue? Specifically, what is the path that Xcode uses to include libxml2?
1
0
547
Oct ’24
Persistent Sandbox Denials When Building with Capacitor and CocoaPods in Xcode
I am a solo developer building a cross-platform voice assistant app using Capacitor (with HTML, JS) and Xcode for the iOS version. The app is called "Echo Eyes," and it already functions well as a Progressive Web App (PWA). However, the iOS build has been completely blocked due to persistent sandbox permission errors from macOS during the CocoaPods framework embedding phase. This issue has caused severe disruption to my project and personal well-being, and I am writing to formally request assistance in identifying a clear solution. I am not a beginner and have followed all known best practices, forums, and Apple guidance without success. What I’ve Built So Far: Fully working PWA version of the app (voice input, HTML/JS interface) Capacitor initialized with ID: com.echo.eyes.voice Capacitor iOS platform added with CocoaPods App runs fine until Xcode reaches: [CP] Embed Pods Frameworks The Exact Problem: Sandbox: bash(12319) deny(1) file-read-data /Users/Shared/projects/Echo_Mobile/ios/App/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh Command PhaseScriptExecution failed with a nonzero exit code Clarification: This is not an HTML/JS issue. The failure occurs in Xcode long before web assets are embedded into the bundle. The shell script /Pods-App-frameworks.sh cannot be read due to macOS sandbox restrictions. Everything I’ve Tried: Gave Xcode and Terminal Full Disk Access Ran: sudo xattr -rd com.apple.quarantine on the entire Pods directory Added /bin/bash and /bin/sh to Full Disk Access (after confirming the exact shell via $SHELL) Attempted to disable Gatekeeper via Terminal: sudo spctl --master-disable (confirmed not effective without GUI toggle) Tried relocating project to /Users/Shared/projects/ Cleaned build folder, removed derived data, reinstalled pods Debugged shell usage with: echo "▶️ Embedding under shell: $SHELL" in the [CP] Embed Pods Frameworks script Attempted to grant shell access to Documents Folder, Desktop, and more via Files &amp; Folders Current State: Despite following all known and recommended steps, Xcode continues to return the same sandbox error. The shell script that embeds the CocoaPod frameworks is denied permission to read its own contents by macOS. What I Am Asking For: Is this a known issue in current versions of macOS or Xcode regarding sandbox denial for shell execution inside Pods? Is there a recommended method to grant /bin/bash or /bin/sh permission to read and run these scripts under Xcode without compromising system security? Is moving the project outside /Users (e.g. to /Projects) the only real workaround? Are there official Apple workarounds or entitlements available for developers encountering this? Personal Note: This issue has caused significant emotional and physical distress. I’m building this app as a personal healing tool and companion. I’ve poured months of work into this and done everything I can to follow Apple’s development guidelines. I’m not asking for hand-holding — only a clear, respectful response confirming whether this is expected behavior and what can be done to resolve it. Thank you for your time and understanding.
0
0
120
Jun ’25
Unexpected app version in logs — does MARKETING_VERSION change dynamically?
Hello, I've encountered unexpected behavior related to version information in our app logs, and I'd like to ask for some advice. We reviewed logs collected from a user running our app (currently available on the App Store). The logs are designed to include both the build number and the app version. Based on the build number in the logs, we believe the installed app version on the user's device is 1.0.3. However, the app version recorded in the logs is 1.1.5, which is the latest version currently available on the App Store. In our project, we set the app version using the MARKETING_VERSION environment variable. This value is configured via XcodeGen, and we define it in a YAML file. Under normal circumstances, the value defined in the YAML file (MARKETING_VERSION = 1.0.3) should be embedded in the app and reflected in the logs. But in this case, the version from the current App Store release (1.1.5) appears instead, which was unexpected. We'd like to know what might cause this behavior, and if there are any known factors that could lead to this. Also, is it possible that MARKETING_VERSION might somehow dynamically reflect the version currently available on the App Store? YAML: info.plist:
0
0
56
Jun ’25
Device UDID duplicated 6 times in Enterprise Account Devices list
Sometime since July 2024 the list of devices in our Enterprise Account is showing the same device and UDID 6 times. Looking at the DATE REGISTERED field it is apparent that each instance of the device represents the 'old' device that should have been 'deleted' when the annual device reset was actioned. The date registered field shows dates with 2019, 2020, 2021, and so till 2024 (most recent). I have 'disabled' two of the entries to see what happens, and those instances were disabled as expected without impacting the other instances. However, when attempting a re-enable of them, an error throws saying that they cant be enabled because that UDID already exists - obviously the other instances. For now, I have left 4 active duplicates in place, and the 2 disabled ones as they are, and plan to deal with this again - if it re-occurs in 2025. It does not seem to have impacted provisioing profiles - so will leave well enough alone. I am sure if I disable all of them, I will not be able to re-enabled any of them. Is this a know issue? Is this the best strategy? - ie, wait till device reset next year and hope issue is resolved. This post had similar issue, in 2023, but no response Forum Post 733264
0
0
431
Nov ’24
Help Analyzing Crash Logs – Auto Layout Threading Violation, Memory Pressure, CPU Usage
We're facing critical stability issues with a Xamarin-based iOS warehouse management app and need expert validation of our crash log analysis. We’re seeing recurring issues related to: Auto Layout Threading Violations Memory Pressure Terminations CPU Resource Usage Violations These are causing app crashes and performance degradation in production. We've attached representative crash logs to this post. Technical Validation Questions: Do the crash logs point to app-level defects (e.g., threading/memory management), or could user behavior be a contributing factor? Is ~1.8GB memory usage acceptable for enterprise apps on iOS, or does it breach platform best practices? Do the threading violations suggest a fundamental architectural or concurrency design flaw in the codebase? Would you classify these as enterprise-grade stability concerns requiring immediate architectural refactoring? Do the memory logs indicate potential leaks, or are the spikes consistent with expected usage patterns under load? Could resolving the threading violation eliminate or reduce the memory and CPU issues (i.e., a cascading failure)? Are these issues rooted in Xamarin framework limitations, or do they point more toward app-specific implementation problems? Documentation & UX Questions: What Apple-recommended solutions exist for these specific issues? (e.g., memory management, thread safety, layout handling) From your experience, how would these issues manifest for users? (e.g., crashes, slow performance, logout events, unresponsive UI, etc. JetsamEvent-2025-05-27-123434_REDACTED.ips ) WarehouseApp.iOS.cpu_resource-2025-05-30-142737_REDACTED.ips WarehouseApp.iOS-2025-05-27-105134_REDACTED.ips Any insights, analysis, or references would be incredibly helpful. Thanks in advance!
0
0
51
Jun ’25
Debugging State Restoration
I'm adding state restoration to an old iOS app that does not use scenes or storyboards. Creating of view controllers is entirely programmatic. I found the restorationArchiveTool for iOS which is very helpful. However it also refers to a StateRestorationDebugLogging mobileconfig profile that is supposed to turn on additional debug logging when restoring state. https://download.developer.apple.com/ios/restorationarchivetool_for_ios_7/StateRestorationDebugLogging.mobileconfig However I do not seem to be able to install it to either a simulator or my device. Does anyone know if this profile is still valid? If so, how do I install it? Tom Aylesworth
0
0
322
Jan ’25
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
476
Nov ’24
Guideline 2.1 - Performance - App Completeness We were unable to review the app because it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue. Review device details: - Device type: iPad Air (5th generation)
Hi, I developed an app. It is using Firebase Cloud Messaging to send notifications. I got my 5th rejection from Apple. I tried to distribute the app from Xcode with new Provisining Profile and Certificates but it go rejected. I used EAS to distribute it automatically but 5 minutes ago it is again rejected. I tried on iPhone and iPad simulators, it is working perfectly fine. Even sending notifications are working perfect. Please can you help me? My crash reports are : crash1 crash2 crash3
1
0
526
Oct ’24
Unexpected error building on Ventura 13.4
Up to now I've been building my x64 binaries on Sequioa specifying a target macOS level of 13.4. That worked fine. In an attempt to debug a problem that was causing some pain I created a 13.4 x64 build environment and tried to build the code there. This code: using CacheKeyType = std::filesystem::path; using CacheValueType = std::tuple<LoadedImage, int, bool>; // <image, lastUse, currentlyLoading> using CacheType = std::unordered_map<CacheKeyType, CacheValueType>; friend class ThreadLoader; static inline constexpr int16_t MAXIMAGESINCACHE = 20; static inline constinit std::atomic_int age{ 0 }; static inline std::shared_mutex rwMutex{}; static inline CacheType imageCache{}; got me the following errors: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__hash_table:838:5: error: static_assert failed due to requirement 'integral_constant<bool, false>::value' "the specified hash does not meet the Hash requirements" static_assert(__check_hash_requirements<_Key, _Hash>::value, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/__hash_table:853:1: note: in instantiation of template class 'std::__enforce_unordered_container_requirements<std::filesystem::path, std::hash<std::filesystem::path>, std::equal_to<std::filesystem::path>>' requested here typename __enforce_unordered_container_requirements<_Key, _Hash, _Equal>::type ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/include/c++/v1/unordered_map:1152:30: note: while substituting explicitly-specified template arguments into function template '__diagnose_unordered_container_requirements' static_assert(sizeof(__diagnose_unordered_container_requirements<_Key, _Hash, _Pred>(0)), ""); ^ /Users/amonra/.vs/DSS/build/DeepSkyStackerKernel/DeepSkyStackerKernel_autogen/EWIEGA46WW/../../../../DeepSkyStackerKernel/imageloader.h:60:26: note: in instantiation of member function 'std::unordered_map<std::filesystem::path, std::tuple<LoadedImage, int, bool>>::~unordered_map' requested here static inline CacheType imageCache{}; ^ 2 errors generated. Which isn't "mega-helpful" :( I thought that specifying: set(CMAKE_OSX_DEPLOYMENT_TARGET 13.4 CACHE STRING "Minimum operating system version for deployment" FORCE) would have made the compilations use the same headers as for Ventura above, but it seems not? Is this to be expected?
5
0
115
Jun ’25
On-demand resource exporting?
I'm a newbie to on-demand resources and I feel like I'm missing something very obvious. I've successfully tagged and set up ODR in my Xcode project, but now I want to upload the assets to my own server so I can retrieve them from within the app, and I can't figure out how to export the files I need. I'm following the ODR Guide and I'm stuck at Step #4, after I've selected my archive in the Archives window it says to "Click the Export button", but this is what I see: As shown in the screenshot, there is no export button visible. I have tried different approaches, including distributing to appstore connect, and doing a local development release. The best I've been able to do is find a .assetpack folder inside the archive package through the finder, but uploading that, or the asset.car inside it, just gives me a "cannot parse response" error from the ODR loading code. I've verified I uploaded those to the correct URL. Can anyone walk me through how to save out the file(s) I need, in a form I can just upload to my server? Thanks, Pete
0
0
44
May ’25
Can’t Enable Developer Mode on Apple Watch – No Prompt Appears
Hi, I’m currently developing a watchOS app and ran into an issue where I can’t enable Developer Mode on my Apple Watch. Device info: Apple Watch Series 9 (watchOS 10.4) Paired with iPhone 14 Pro (iOS 17.4.1) Xcode 15.3 (macOS 15.5, Apple Silicon) Issue: When I try to run the app on my physical watch device, Xcode prompts that Developer Mode needs to be enabled. However, there is no approval request on the Apple Watch, and no Developer Mode option appears under Settings → Privacy &amp; Security. I’ve already tried the following: Rebooting both devices Unpairing and re-pairing the watch Erasing and setting up the watch again Signing out and back into my Apple ID Using the latest Xcode version (15.3 and 16.3 both tested) Running clean builds and checking provisioning profiles Attempting install via both simulator and physical device Still no luck — the app will not launch on the Apple Watch due to Developer Mode being disabled, and the option is missing entirely from Settings. I visited an Apple Store Genius Bar, but they couldn’t help and told me to contact Developer Support. I’ve already submitted a support request, but in the meantime I wanted to ask here in case anyone else has experienced this and found a workaround. Thanks in advance.
0
0
85
May ’25