Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Pinned Posts

Posts under Xcode tag

3,079 Posts
Sort by:
Post not yet marked as solved
0 Replies
47 Views
Hello, I have a swift package that supports visionOS and one of its targets is a xcframework that also support visionOS and when I try to archive that swift package (using xcodebuild archive) I get this error: note: '<xcframework path>' is missing architecture(s) required by this target (x86_64), but may still be link-compatible. (in target '[library name]' from project '<swift package name>') But starting in Xcode 15.2 (I have Xcode 15.4 installed), you cannot develop for visionOS on Intel machines. So why does it require that the xcframework needs x86_64 support for the visionOS simulator? Any help would be great. Thanks!
Posted
by
Post not yet marked as solved
0 Replies
47 Views
Xcode 15 introduced official support for static frameworks. docs here This is presumably because there's quite a bit over overlap with the mergeable libraries feature. Static frameworks potentially give developers a nice option for bundling resources with a static library. This was previously only really viable if you explicitly packaged up a .bundle with your .a (static library) which could be cumbersome for both the creator and consumer of a library. Or you explicitly copied your framework resources into your main app binary when building your app. The release notes for Xcode 15 state: Embedding a static framework using a Copy Files build phase now removes the static archive from the framework when it is embedded in the target bundle. When inspecting the app target on disk this appears to be the case. In fact the behaviour is the same as with a mergable in release mode whereby a "stub" binary exists with no symbols. The release notes also state: The COPY_RESOURCES_FROM_STATIC_FRAMEWORKS build setting, previously used in the legacy build system to extract and copy the resources from a static framework to the target bundle, no longer has any effect with the new build system as the entire framework is copied instead This also appears to be the case when inspecting the files on disk as the frameworks appear to be present in the main app with their resources. So far so good. The issue arises when trying to access the bundle associated with this framework. The documentation doesn't mention any special access requirements to it's assumed that standard bundle access APIs should work. Using a class let bundle = Bundle(for: InfoCoreMain.self) This returns the main application bundle and therefore fails to find the correct asset. This can be rationalised by the fact that the InfoCoreMain class does now actually exist within the main app target binary due to being statically linked. It's worth noting however, that mergable libraries in release mode do seem to work in this way and can resolve the bundle fine*. Using an explicit bundle identifier let bundle = Bundle(identifier: "***.***.InfoCore") Using an explicit bundle identifier returns nil even though we can see the framework on disk. Using a path Using a path to access the framework also doesn't work. if let bundlePath = Bundle.main.path(forResource: "InfoCore", ofType: "framework") { let bundle = Bundle(path: bundlePath) // Now you can access resources in the framework bundle } else { // Framework bundle not found } All of the above is the same behaviour for release and debug builds. I have tried this on Xcode 15.2 and 15.3 *Mergeable libraries do seem to have issues in debug mode. See this forum post. https://forums.developer.apple.com/forums/thread/749818
Posted
by
Post not yet marked as solved
0 Replies
53 Views
I am in a weird twilight-zone of a git problem in xcode. I specify some files to be staged and it fails to do with no warning of any sort. So I cannot commit them or apply stashed changes to them. I can do it one.file.at.a.time. I have over 11k intermediate files that .gitignore won't ignore, nor stage nor commit to do anything so I could stop tracking them.
Posted
by
Post not yet marked as solved
1 Replies
88 Views
I try ti create a new project but Xcode don't let me do this... The "Next" button doesn't let me to continue.
Posted
by
Post not yet marked as solved
0 Replies
51 Views
I wan't to use Java in Xcode the class file is Main.class. So I set scheme -> run to a script like this: #!/bin/sh java -cp $(dirname $0) Main But when I run it, java said : Error: Could not find or load main class Main Caused by: java.lang.ClassNotFoundException: Main How can I fix this problem? And: It's really helpful to answer in Chinese if you know it.
Posted
by
Post not yet marked as solved
0 Replies
78 Views
After a while I returned to Xcode . I bought a new Mac mini M2 and I installed the Xcode 15.3. To familiarize with the changes in the plataform I follow the tutorial you provide. I create a new iOS app following the instructions. I clicked in the ContentView and I was supposed to see in the canvas a representation of an iPhone running my app. Insteady I saw an error message "Cannot preview in this file - Unexpected error ocurred". I'm blocked in this situation . Do you have a solution for that? The code is provided by your tutorial. I didn't change it. Thanks for your help in this matter. Fernando
Posted
by
Post not yet marked as solved
1 Replies
51 Views
I was watching https://developer.apple.com/videos/play/wwdc2023/10248/ , in this video it is adviced to make below shated property async to benefit from concurency (in video 40:04 , exact time) , do yo know how to do it ? class ColorizingService { static let shared = ColorizingService() func colorize(_ grayscaleImage: CGImage) async throws -> CGImage // [...] } struct ImageTile: View { // [...] // implicit @MainActor var body: some View { mainContent .task() { // inherits @MainActor isolation // [...] result = try await ColorizingService.shared.colorize(image) } } }
Posted
by
Post not yet marked as solved
4 Replies
75 Views
I just bought a m2 MacBook Pro running latest Xcode / Sonoma from apple refurbed. I am porting from an older macbook pro/intel chip a project that uses pthread. as this is my first week using the laptop, I recompiled the project but the apple linker does not find the libpthread library. I see it is not included in the installed Xcode. how do I get this library from Apple? regards Dave
Posted
by
Post not yet marked as solved
2 Replies
108 Views
Hello! We are experiencing crashes on iOS both in debug and release builds in a game made in Godot 3.5.1. The main problem is that we don’t know where exactly the problem is and cannot understand how could we find a way to fix it. We don't expect that someone here will know how to fix this on Godot's side, but we would appreciate some help on how to get more info about the problem and potentially fix it. Debug builds: It is way more frequent in debug builds when we make a build, open it in Xcode, and install it directly on an iOS device. The first type of the crash in debug build is occurring like 70% of the time when the game is loading and trying to get into its main menu. The thing we are getting in Xcode looks like on first image below. Another type of crash happens when we open some save files and start the actual playable part of the game. It happens just after moving the character a few steps and it looks like on second image below. We are aware that the log recommends using breakpoints to find where exactly the problem is, but the thing is that we don’t know where we could do that in Xcode. We are not sure if we are missing something in Xcode or if we cannot do that when opening a project made in Godot. We tried many different builds with removed shader files, and scenes and changed different kinds of settings. We would get the same crash every time. When we made a new build, we cleared the build’s folder. Also, we occasionally deleted the .import folder of the project during development and reimported it. The problem occurred on many different iOS devices with more than 4GB of RAM. Release builds: These builds are uploaded on TestFlight. In release builds crashes wouldn’t occur like in debug builds. They would happen like totally randomly. In some testing sessions, it would happen like 10 minutes in the game, and in others in a few hours. Some testers couldn’t get the crash and altogether and we couldn’t find some repro steps to produce these crashes. In the attached files, you can find logs that we managed to collect from TestFlight. The most frequent type of the crash that we got, is following: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS Additional info: From reading Apple’s documentation Investigating memory access crashes, we got it that the problem is in “Invalid memory fetch”, but we couldn’t find how this could help us with further investigation. When we used Address Sanitizer tool and made a build, suddently the game stopped crashing in debug builds like it did before. Also we then didn't receive logs in Xcode that would hint us that something is going on. Tried to build our project in newer version of Godot, but the problem still persisted. Used software and hardware: Godot 3.5.1 macOS, Ventura, 13.5 Xcode, 15.2 iPad Air (5th generation), 17.4.1 MacBook Pro, Apple M1 If you have some clues or ideas on how to fix this problem, please write it, it would mean us a lot. Don’t hesitate to ask questions if something is unclear. Thank you very much in advance!
Posted
by
Post not yet marked as solved
0 Replies
68 Views
I'm working on some apps at the minute, with the intention of running a lot of automated UI tests. Xcode cloud looks great and has a lot of integrated features, but having to make sure I don't run too many hours so my subscription doesn't stop mid dev cycle, or getting a surprise large bill etc, are things I want to avoid. Even the cheapest paid plan for a year works out about the same cost as an M2 mac mini, which would probably be significantly faster than the cloud nodes. Github actions allow you to provide your own machines. But actions requires a lot more scripting, and so far they've been very slow to update Macos/Xcode versions (not sure how this will effect supplying own machine). My preference would be to deploy my own machine for Xcode cloud, similar to what we used to be able to do with Xcode server. I think this is currently impossible right? Is there any word that this might be an added feature in the near future?
Posted
by
Post not yet marked as solved
1 Replies
65 Views
I am working on a white label product and have around 400+ white label customers with minor changes in color, assets, and strings. I am considering creating a workspace and adding all customer projects to the workspace. However, I am unsure about the limitations of Xcode workspace. How many projects can be added to an Xcode workspace?
Posted
by
Post not yet marked as solved
0 Replies
52 Views
In order to test an iPhone app I am developing on my mac on an actual device, I connected my iPhone to my mac with a wired connection and installed the app, but got an error message saying “Uneble to verify app”. I went to Settings -> General -> VPN and Device Management -> the app in question in ENTERPRISE APP -> Verify App -> Verify, but no matter how many times I tap on it, the status of the app remains “Not verified”. If anyone has a solution to this problem, we would appreciate it if you could help us.
Posted
by
Post not yet marked as solved
0 Replies
65 Views
We are received the following error while uploading the application into TestFlight. **ITMS-90714: Invalid binary - The app contains one or more corrupted binaries. Please rebuild the app and resubmit. ** After sometimes we submit the same application without changing the configurations application submitted successfully into the App Store. We are using the Xcode 15.3 version.
Post not yet marked as solved
4 Replies
1.2k Views
After uploading a new iOS build, we received an error message via email from Apple stating: "ITMS-90013: Corrupt Image File - The image file "AppIcon60x60 2x.png" appears to be corrupt." Strangely, we don't have any image file with that name in our project. It seems to be a build processing error on Apple's side. While I've seen similar issues reported for Apple TV in the past, this is happening with our iOS build. Has anyone discovered a workaround? I've uploaded another app build and haven't encountered any errors.
Posted
by
Post not yet marked as solved
2 Replies
74 Views
Hi, our app has been using single size app icon for a while and today when I trying to upload a new version of our app I got an email from App Store Connect saying ITMS-90013: Corrupt Image File - The image file 'AppIcon60x60@2x.png' appears to be corrupt. We haven't touched the image for ages and these 60x60 image were generated by Xcode from the single 1024x1024 image supplied. I've tried to use a new image and still got the same error. Does anyone experienced this recently?
Posted
by
Post not yet marked as solved
1 Replies
48 Views
Hello everyone, I have a problem in a project I am currently working on. Some background information regarding the problem is that I am creating some buttons in a foreach loop in another script that retrieve information from a server. These buttons are displayed in a grid with a width of 2 entries. The element that the buttons belong to also contain a fullScreenCover functionality, but the full screen cover functionality is only being called for the top four entries in the grid but the button works on all of the entries. Here is the partial code: Button(action:{ let _ = print("Button was clicked",self.title) isDetailPresented.toggle() let _ = print("Button was clicked",self.isDetailPresented) }) { VStack { ... } .foregroundColor(Color.black) .fullScreenCover(isPresented: $isDetailPresented, onDismiss: { //some function is being called here let _ = print("Moving on") }, content: { let _ = print("I have moved on") //a view to be opened }) I already checked that the boolean changes on all entries but I can't figure out why the content is not being displayed for the entries below the 4 top ones. Any help would be appreciated.
Posted
by
Post not yet marked as solved
1 Replies
70 Views
HI i have coded an App for Mac OSX that has embedded a Command line tool, the problem is that everything works fine while i am running from the xcode compiler, after build the final product, the app is not working properly and i can see messages like this in the console. Task .<251932> not allowed to create a new connection (existing Connection 224) Task <37752B7F-5827-4160-83C4-773B17AE72DF>.<255990> resuming, timeouts(60.0, 604800.0) QOS(0x21) Voucher (null) i was reading a link posted here but the solution is not working, some ideas are appreciated. My guess is that maybe is something related with a security setting. This is the code: NSTask *task; NSString *executableName = @"websocat"; NSString *executablePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:executableName]; task = [[NSTask alloc] init]; [task setLaunchPath:executablePath]; Quinn “The Eskimo!" please help!
Posted
by
Post not yet marked as solved
0 Replies
72 Views
I am converting a large core data app to SwiftData and have hit a problem I can't fix, namely code generated by a Model crashing. Here is the model showing the failing expansion. Here is the model containing the inverse for the failing attribute: /Users/writingshedprod/Desktop/Screenshot 2024-05-08 at 20.21.51.png And here is the mass of core data output generated when the app launches. If anyone can make sense of this I'd be grateful. This is where the problem might lie. Debugger.txt
Posted
by