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

Why Must All Attributes in a Composite Type Be Optional?
I recently encountered an issue involving Core Data’s new Composite Attributes feature and thought I would share my experience, as well as seek clarification. I created a composite type where all attributes were mandatory, except for one. Subsequently, I added an attribute to an entity and set its type to that composite type. Upon running the app, the console output the following error: CoreData: error: CoreData: error: Row (pk = 85) for entity ‘(EntityName)’ is missing mandatory text data for property ‘(propertyName)’ The way I resolved this was by removing the composite type attribute from the entity, after which the error no longer appeared. I also observed that in another entity, where a different composite type is used, all the attributes were optional — and no error occurred. This raises the question: why must all attributes in a composite type be optional? Furthermore, why does Xcode not inform the developer of this requirement? I have reviewed both the documentation and the WWDC23 “What’s New in Core Data” session, but neither mentions that having non-optional attributes within a composite type will cause such errors and lead to unpredictable application behaviour. Additionally, this issue remains unresolved in another area I raised previously in this topic: Composite Attributes feature requires tvOS deployment target 17.0 or later Composite Attributes feature requires watchOS deployment target 10.0 or later However, I do not have a tvOS or watchOS target, nor do I intend to add one. Could someone from Apple, or anyone with more experience, please clarify why all attributes within a composite type must be optional? And could it be possible for Xcode to flag this at compile time, rather than failing at runtime? Thank you in advance.
0
0
48
Apr ’25
Xcode Simulator Can't Boot
I am facing a recurring issue with Xcode iOS simulator. I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up. I receive the follow error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Deleting Xcode cache Reinstalling iOS Simulator runtimes Completely uninstalling Xcode and deleting all developer data, then reinstalling None of the above steps fix the problem. The only fix I have found is to completely reinstall MacOS 15.4.1. THIS IS TERRIBLE! I have already reinstalled MacOS 15.4.1 once to fix the issue, and I don't want to do it again. If there is another solution, please help me find it! Thank you!!
15
2
290
3w
Why is there no Embed section in Xcode's Frameworks & Libraries section
If I create an Xcode (version doesn't matter, 16.N )project of type framework then install some dependencies using SPM. Then within the Frameworks and Libraries section, the Embed part is empty. This doesn't happen if the project type is app rather than framework. If I want to set this to embed or not embed then how can this be done if its not even visible, for that matter how can I tell what it is set to even?
1
0
46
Apr ’25
Xcode 16.3 C++ compiler makes binaries with corrupted memory.
I am creating an xcframework for a static library for iOS, but I am encountering a perplexing issue with Xcode 16.3. When I build an xcframework using C++ in one project and import it into another project, the application runs with corrupted memory. In the framework project, I use os_unfair_lock, but when attempting to lock, the app crashes due to a state error. This suggests that memory corruption is occurring. When the xcframework is built with Xcode 16.2, a proper binary is generated, and the app runs without any problems. Since I do not want to disclose the source code, I am trying to construct a minimal project that reproduces the issue, but so far I have not been successful. Fundamentally, I feel that the compiler in Xcode 16.3 cannot be trusted.
0
1
78
Apr ’25
Issue with react-native-vision-camera on iOS build - Compatibility and C++ Version Problem
Hi everyone, I'm encountering a persistent issue when trying to build my React Native project for iOS. I'm using the react-native-vision-camera library (version 4.6.4) and I've set my iOS deployment target to 16.0 in the app.json file. Despite this, the build process fails with an error related to the react-native-vision-camera pod, which seems to be stuck on an older version (2.15.4) that requires a different C++ version and a lower deployment target. Here's what I've tried so far: Ensured that the C++ version is set to 17 as required. Cleared and reinstalled all pods (rm -rf ios/Pods ios/Podfile.lock followed by pod install). Confirmed that the deploymentTarget in the app.json is set correctly to 16.0. However, the error persists and the build continues to fail, pointing to a compatibility issue with the react-native-vision-camera pod. I'm not sure if there's a cache issue or a configuration step I'm missing. Environment: React Native version: 0.76.7 react-native-vision-camera version: 4.6.4 iOS deployment target: 16.0 Expo SDK version: 52.0.40 Attached: app.json, eas.json, package.json, and the error log screenshot. Error log screnshot: Files: app.json eas.json package.json Any insights or suggestions from the community or Apple engineers would be greatly appreciated. Thank you!
1
0
55
Apr ’25
EXC_BAD_ACCESS if Address or Thread Sanitizer is enabled
I'm getting EXC_BAD_ACCESS (code=2, address=0x7ff8a6e2fcce) when launching my app on the simulator with Address or Thread Sanitizer enabled. I'm running Xcode 16.3 (16E140) on macOS Sequoia 15.4.1 (24E263). The call stack looks like the following. On the device, there is no crash, but this message is printed to the console: malloc: nano zone abandoned due to inability to reserve vm space. (Not sure if it's related.) Does anybody know what is causing the crash? Thread 1 #0 0x0000000103361f5b in __sanitizer::MemoryMappingLayout::Next () #1 0x000000010336034b in __sanitizer::MemoryRangeIsAvailable () #2 0x000000010334db77 in __asan::InitializeShadowMemory () #3 0x0000000103395069 in __asan::AsanInitInternal() (.cold.1) () #4 0x000000010334d352 in __asan::AsanInitInternal () #5 0x0000000103394f65 in __asan_init.cold.1 () #6 0x000000010334d325 in __asan::AsanInitFromRtl () #7 0x0000000103343289 in wrap_malloc_default_zone () #8 0x00007ff801b15f86 in __malloc_init () #9 0x00007ffa160080be in libSystem_initializer () #10 0x000000010306eb11 in invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const () #11 0x000000010308f364 in invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const () #12 0x00000001030aad7c in invocation function for block in mach_o::Header::forEachSection(void (mach_o::Header::SectionInfo const&, bool&) block_pointer) const () #13 0x00000001030a83c9 in mach_o::Header::forEachLoadCommand () #14 0x00000001030a98c8 in mach_o::Header::forEachSection () #15 0x000000010308ef62 in dyld3::MachOAnalyzer::forEachInitializer () #16 0x000000010306e9ac in dyld4::Loader::findAndRunAllInitializers () #17 0x0000000103074da1 in dyld4::JustInTimeLoader::runInitializers () #18 0x00000001030807c5 in dyld4::APIs::runAllInitializersForMain () #19 0x000000010305efac in dyld4::prepare () #20 0x000000010305e36e in _dyld_sim_prepare () #21 0x000000010993b2a0 in dyld4::prepareSim () #22 0x0000000109939963 in dyld4::prepare () #23 0x000000010993981f in dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const () #24 0x00000001099394da in start ()
8
1
303
Jun ’25
bitcode_strip error in xcode 16.3
Since I updated xcode to the version 16.3 everytime I try to use the command bitcode_strip I get an error The command i use is: bitcode_strip test.a -r -o test_no_bitcode.a And it returns the following error ld: file cannot be open()ed, errno=2 path=strip fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: internal link edit command failed I tried downgrading the Xcode version and doing the same thing everything works fine. Is this a known bug or am I missing something?
2
0
228
Apr ’25
Missing Files Xcode Build Error
I have an iOS app. When I install pods via CLI to my project for the first time, launch Xcode, and then run the app, everything works fine – no build errors. But after several instances of running the project on my device, all of a sudden build errors appear like: /Pods/FirebaseCrashlytics/Crashlytics/Crashlytics/Settings/Models/FIRCLSApplicationIdentifierModel.m:19:9 'Crashlytics/Shared/FIRCLSByteUtility.h' file not found /Pods/PostHog/vendor/libwebp/ph_sharpyuv_csp.h /Pods/PostHog/vendor/libwebp/ph_sharpyuv_csp.h: No such file or directory And I have no idea why if it's because of my PodFile or any Build Settings/Phases/Rules, but this keeps happening repeatedly and it's impossible to develop anything with this. I've tried a string of commands such as "pod deintegrate", "pod cache clean --all", removing PodFile.lock and doing pod install again, removing derived data, and cleaning build folder. I still keep running into the same build error and it's always after a few builds this happens, nothing is missing prior when the project successfully builds. Here is my PodFile for reference: # Uncomment the next line to define a global platform for your project platform :ios, '17.0' def google_utilities pod 'GoogleUtilities/AppDelegateSwizzler' pod 'GoogleUtilities/Environment' pod 'GoogleUtilities/ISASwizzler' pod 'GoogleUtilities/Logger' pod 'GoogleUtilities/MethodSwizzler' pod 'GoogleUtilities/NSData+zlib' pod 'GoogleUtilities/Network' pod 'GoogleUtilities/Reachability' pod 'GoogleUtilities/UserDefaults' end target 'SE' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for SE pod 'Firebase/Core' pod 'Firebase/Firestore' pod 'Firebase/Auth' google_utilities end target 'NSE' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for NSE pod 'Firebase/Messaging' google_utilities end target 'targetApp' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! #Pods for targetApp pod 'Firebase/Core' pod 'Firebase/Crashlytics' pod 'Firebase/Messaging' pod 'Firebase/Firestore' pod 'Firebase/Storage' pod 'Firebase/Functions' pod 'PromiseKit', '~> 6.0' pod 'lottie-ios' pod 'GooglePlaces' pod 'JWTDecode', '~> 2.4' pod 'PostHog' pod 'Kingfisher', '~> 8.0' pod 'PhoneNumberKit' google_utilities end post_install do |installer| installer.aggregate_targets.each do |target| target.xcconfigs.each do |variant, xcconfig| xcconfig_path = target.client_root + target.xcconfig_relative_path(variant) IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR")) end end installer.pods_project.targets.each do |target| target.build_configurations.each do |config| if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference xcconfig_path = config.base_configuration_reference.real_path IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR")) config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.0' end end end installer.pods_project.targets.each do |target| if target.name == 'BoringSSL-GRPC' target.source_build_phase.files.each do |file| if file.settings && file.settings['COMPILER_FLAGS'] flags = file.settings['COMPILER_FLAGS'].split flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' } file.settings['COMPILER_FLAGS'] = flags.join(' ') end end end end end And here is my only "Run Script" in Build Phases: "${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" \ -gsp "${PROJECT_DIR}/targetApp/GoogleService-Info.plist" \ -p ios \ "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
3
0
78
Apr ’25
Xcode 16.0 iOS 12 support
We are preparing builds using Xcode 16.0 given we have a large set of users on iOS 12. Now we have doubts wether we will run into issues if we ship using it (even if it compiles, archives and uploads successfully) given the table columns and content has changed since the last time we checked this table: https://developer.apple.com/support/xcode/. 1- Is the Deployment Targets range for Xcode 16 value correct for iOS? (On the 24th of February it had iOS 12-18, now it has iOS 15-18) 2- Are we OK to ship for iOS 12 using xcode 16.3? Thanks, Joao Garcia
2
5
321
Jul ’25
What does “Invalid Binary” mean when uploading my Flutter app to App Store?
Hi! I'm uploading a Flutter app using Xcode 15.3 and everything builds and runs fine on my iPhone. I use automatic signing with valid development and distribution certificates. The upload to App Store Connect completes successfully and shows as “Waiting for Review”, but after a few minutes it changes to: iOS 1.0 — Invalid Binary There are no other error details. I've checked Info.plist, signing settings, build/version numbers, and everything seems okay. Does anyone know what “Invalid Binary” means or what might be causing it? Thanks in advance!
1
0
116
Apr ’25
App Rejected – Binary Invalid Despite Correct Code Signing Setup (Flutter + WebView App)
Hello everyone, I'm currently experiencing repeated "Invalid Binary" rejections when submitting my Flutter-based iOS app ("Master Tere") through App Store Connect. I've followed all the expected steps and guidelines, but the rejection contains no additional explanation beyond the "Invalid Binary" status. Here’s my current setup: Built using Flutter and Xcode 15.3 WebView-based app loading a professional portfolio site Runner target is signed automatically using Xcode Managed Profiles Certificates: Apple Development and Apple Distribution (auto-managed) Bundle ID: com.actuain.mastertere1 Version: 1.0.0, Build: 6 Deployment target: iOS 18.0 Device family: iPhone only All signing identities and provisioning profiles match for Debug and Release In my Info.plist, I’ve cleaned up legacy keys that might cause conflicts: ✅ Removed <key>UIMainStoryboardFile</key> (no storyboard is used) ✅ Removed <key>CFBundleSignature</key> as it was set to ???? ✅ Display name and Bundle ID align with Xcode project settings Despite all this, every time I upload through Xcode Organizer, I get an "Invalid Binary" error after processing. No issues are shown during archive validation. I suspect the issue may be related to: Flutter WebView integration with latest iOS SDKs Residual metadata in the archive from unused iOS storyboard references Possibly missing entitlements or capabilities not flagged by Xcode Questions: Are there any known issues affecting Flutter WebView apps recently (especially around Xcode 15.3 or iOS 18 SDK)? Is it mandatory to remove Main.storyboard from the project bundle even if it's not used? Could this issue be related to background modes, UIRequiredDeviceCapabilities, or entitlements even if not directly flagged? I’d appreciate any insights or experiences from others who’ve faced this issue recently. Thanks in advance! Luis Antonio Pinto Acosta
1
0
103
Apr ’25
Xcode 16.3 Problems
Hi, This problem had gone away with the previous version, but its back with 16.3. When I first go into Xcode, it normally shows me a list of previous projects. This seems to work some of the time, and not others. When it doesn't, I Quit Xcode, go back in, then the list appears again. I also noticed each time I quit Xcode, I get the "beach ball icon" for 5-7 seconds and then it exits most of the time. When it doesn't, I have to issue a killall Xcode in the Terminal. I have a brand new Mac mini M4, 24GB RAM, 2 TB SSDD. Is anyone else having these issues? Thank you, Dan Uff
1
0
154
Apr ’25
Unable to build c++ ios 18.4 headers with xcode 16.3
I have c++ enabled in my project and they build fine in Xcode 16.2. But now iOS SDK c++ files do not compile since “std::char_traits” support has been dropped from compiler during 16.3 update. This is the error I get: /Developer/SDKs/iPhoneOS18.4.sdk/usr/include/c++/v1/ios:543:64 Implicit instantiation of undefined template 'std::char_traits' At least these are broken, maybe more: ios.h basic_ostream.h string.h string_view.h This is rather annoying that Apple's own header files do not compile. Can't fix it by myself. Also other workarounds than downgrading to 16.2 are welcome. Feedback assistant: FB17183862
1
1
332
Apr ’25
Is it possible to view Xcode output from a scheme's archive post actions's script
In Xcode I've: select Product / Scheme / Edit scheme tap on Archive on the left hand side of the select post actions and + to add a new script Then in there I have added a script I want to run on the archive after its created. I'd like to be able to see the output the script churns out as it goes along but doesn't seem possible? If I just add something like echo "hello" to the start of the script then I don't see "hello" visible anywhere when I build an archive (via Product/Archive). I'm looking in the build navigator. Is there somewhere else to look or is it possible to get the logging into the navigator?
0
0
34
Apr ’25
GoogleAPIClientForRest classes not found
I am trying to connect to a google worksheet with a service account and have added the GoogleAPIClientForRest (Drive and Sheets) and GTMSessionFetcher (Core) dependencies to my project. However, this code import GoogleAPIClientForRESTCore import GTMSessionFetcherCore func test() { let x = GTLRServiceAccountCredentials.self let y = GTLRAuthorizer.self print("Classes Found") } I get the the following errors: Cannot find "GTLRServiceCredentials' in scope and Cannot find 'GTLRAuthorizer' in scope. The dependencies are listed in the Link Binary with Libraries section. I have am using the latest versions of OS and Xocod and have reinstalled both to try and resolve this issue with no luck.
1
0
53
Apr ’25
xcode can't find c++ headers
I'm currently working on my own renderer program using c++. Everything was fine until I update the MacOS to 15.4. I keep receiving these errors: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/cerrno:30:5 tried including <errno.h> but didn't find libc++'s <errno.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case." It says I have problem with finding <errno.h> while including . After searching for solutions, I check the related xcode path, xcode-select -p shows : "/Applications/Xcode.app/Contents/Developer", seems fine. And I can actually see the errno.h file in the folder "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/errno.h" I tried to use CommandLineTool's SDKs by sudo xcode-select -s /Library/Developer/CommandLineTools but not working. The error Information says: This usually means that your header search paths are not configured properly.The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case. Additionally, after running xcodebuild -showsdks, it shows two identical macosx sdks "macos 15.4". Could this be a hint? I also have tried reinstall xcode, not working. I've just created a simple project including and running std::cout << errno, it worked fine. So I tried to run it in my renderer program by cutting all the compile sources except "main.cpp", it still get the errors. What have changed? How do I set things right?
2
0
124
Apr ’25