I am getting this error in a couple of places in my code with Task closure after setting Swift 6 as Language version in XCode.
Passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure
Below is minimally reproducible sample code.
import Foundation
final class Recorder {
var writer = Writer()
func startRecording() {
Task {
await writer.startRecording()
print("started recording")
}
}
func stopRecording() {
Task {
await writer.stopRecording()
print("stopped recording")
}
}
}
actor Writer {
var isRecording = false
func startRecording() {
isRecording = true
}
func stopRecording() {
isRecording = false
}
}
While making the class Recorder as Actor would fix the problem, I fear I will have to make too many classes as Actors in the class and in my scenario, there could be performance implications where real time audio and video frames are being processed. Further, I don't see any race condition in the code above. Does the error talk about possible race conditions that could arise if I were to call other functions on the self in future, or the current code itself is not safe?
Dive into the vast array of tools, services, and support available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello Apple Developer Community,
I am encountering an issue while trying to pay the $119.99 Apple Developer Program fee through the Apple Developer app. I have linked a prepaid card to my Apple ID, which works perfectly fine for other purchases and subscriptions, but I am unable to complete the payment for the developer fee.
Here are the details of the issue:
Payment Method: Prepaid card connected to my Apple ID.
Amount: $119.99 (Apple Developer Program fee).
Location: Cameroon.
Other Transactions: All other purchases and subscriptions using the same prepaid card have been processed successfully without any issues.
When I attempt to pay for the developer fee, the payment doesn’t go through, and I receive an error message (Payment Failed). I’ve verified that my card has sufficient funds and that the information is correctly entered in my Apple ID account settings.
Has anyone else faced a similar issue, particularly with prepaid cards or payments in Cameroon? Any advice or guidance on how to resolve this problem would be greatly appreciated.
Thanks in advance for your help!
Ive been working on android studio and have my app put together and was gonna start thr apple process and everything I read says I'll need a Mac to do it. Can someone either point me in the right direction or could I send my code over and someone compile my code for me?
Topic:
Developer Tools & Services
SubTopic:
General
Hello.
We have a few iOS devices connected to CI macs. We test our 3D engine, so we really need hardware devices for that. The issue is that Xcode loses connection to the devices once in a while, mostly after mac reboot, which requires a human to enter test room and unplug and plug cable again. Even if device is visible and accessible in Finder, Xcode may still don't see it, and devicectl shows it as disconnected.
Are there any hacks to make connection stable? The best what we could achieve so far was to remove iOS device screen lock - otherwise mac reboot would in 100% cases require human interaction to reconnect the device.
Both iOS and mac are logged into the same Apple ID.
Mac is logged in automatically after reboot
iOS devices have no screen lock
Thank you.
I have an issue during enroll apple developer account there is a mes says “Enrollment through the Apple Developer app is not available for this Apple Account. Visit http:// developer.apple.com/programs/enroll/.”
if anyone can help me with my case .
i have been facing this issue for 6 months please help me out
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Good Hello,
I'm looking for the invoice for the developer account but I can't get my hands on it, does anyone know where it's hidden?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
After upgrading to XCode 16.2, I am not able to see apple watch in xcode. I was able to see in XCode 15.2.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi everyone,
(I am running on an M2 MacBook Pro 14 inch with 96 GB of memory)
I've been profiling with Instruments to find out why program suddenly goes from full CPU usage (all of my threads active and all cores working) to about 33% CPU usage. An Instruments system trace is showing me a massive performance cliff where I suddenly get taken off the performance cores and only run on efficiency cores. The performance cores are then occupied by "kernel.release.t6020". What is this thing?
I have kernel callstacks enabled but I only get the instruction pointer and have no symbols for any of those callstacks. I'm accustomed to Windows development where kernel symbols are available so you can see deeply into the kernel to know why you're spending time there (for example, semaphore wait or thread scheduling). Is there a way for me to get a similar level of information or kernel symbols so I can see what the kernel is doing?
Around the time I observe the performance cliff, I also noticed in the narrative view some of the preemptions are done "because thread was balanced off CPU i (P Core) to optimize the system's CPU performance". What does this mean? Have I begun to hit some sort of thermal limit?
Here are some example screenshots of what I am seeing in Instruments:
Topic:
Developer Tools & Services
SubTopic:
Instruments
Hello, I would like to obtain the average CPU usage of a trace I ran through instruments by looking at the cpu profiler. Is there any way to do this? Or should I be using another instrument.
I have tried all of the above options, cleaned cached data, restarted several times, did not work.
The tunnel connection failed while the system tried to connect to the device.
Domain: com.apple.dt.RemotePairingError
Code: 4
System Information
macOS Version 15.2 (Build 24C101)
Xcode 16.2 (23507) (Build 16C5032a)
iOs 18.1.1
I am trying to build my watch app on my series 4 Apple watch currently running WatchOS 10.3 with a deployment target of 10.2 and Xcodes claims that my watch's OS version is too low. I have fully updated my watch to 10.3, tried to downgrade the deployment target to no avail. Xcode doesn't seem to be getting any data on what OS version my watch is running. It says watchOS () in the manage run destinations page. I imagine this is a problem with the connection between my watch and my mac but I cannot solve it. Any advice?
I have an existing project, that's hosted in a self-hosted gitlab instance. Git works through terminal just fine (and has for years!) and the Source Control Navigator pane in Xcode shows the remote repository. However when I try to setup Xcode cloud I get a warning that there's the project does not hav a remote repository. I've tried clearing derived data, cleaning the build folder, restarting to no avail. I even tried creating a new project in Xcode, and having Xcode create the remote repository (which it did successfully). But no matter what I try it will not recognize the remote repository. I've also tried adding another remote origin, and I can see it just fine in the Xcode Source Control pane, but the Xcode cloud setup does not recognize it.
Any suggestions?
Topic:
Developer Tools & Services
SubTopic:
Xcode Cloud
How do I cancel my Apple Developer autopay
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Hi,
I'm trying to register the application with Xcode Cloud.
For that, I click on the "cloud" button in Xcode.
First steps goes OK, but it fails at "create App on App Store Connect"
The error is Cannot register the product
Usually, I change the bundle name, but this time it gets weird, as Xcode managed to create the Identifier, as it is not taken.
So the identifier is created in the developer portal but it fails anyway.
I also tried to create the app directly in the portal, and it works, therefore the app name is not the problem.
Then I delete the app and try again with Xcode and it fails...
Any solution for this issue please?
Hello everyone, my iPhone keep on showing multiple "Trust this Computer" alert simultaneously which I cannot tap on it to Trust. As a result, I cannot run my XCode project on my device. Does anyone has any ideas or solutions to fix this ?
Solution I have tried:
Reset Location & Privacy
Reset Network Settings
Enable Developer Mode
Restart Device
My devices specs:
iPhone 15 Pro: iOS 18.2.1
Macbook Pro M3 Max: Sequoia 15.1.1
Topic:
Developer Tools & Services
SubTopic:
General
Hi,
Our organization develops a Mac app and distributes it our of the Mac store. We have been creating App.dmg files for this and signed it with the Developer ID Application certificate and uploaded them for notarization using "xcrun notarytool". Everything was working fine until we created a new Developer ID Installer certificate to test the new App.pkg installer and uploaded it for notarization to the Apple server. It's been 3 days now and our production pipeline is stuck because all the submissions remain in In-Progress state and do not proceed further.
Details of the submission:-
createdDate: 2025-01-03T06:44:20.306Z
id: 7af70d77-1bab-4b17-aeba-7ddc75c030f9
name: XXXXXXXXXXXXXXX.pkg
status: In Progress
Since then, no submission(even for .dmg files) are processing through. I’ve raised a ticket with the support team as well, but it hasn’t helped. What more can we try to get out of this hole?
i've a problem about unit test and code coverage the problem is when i run unit test on xcode 15.2 code coverage and execuable line is show normally but when i upgrade to xcode 16 code coverage and executable line is always show 0 how can i fix that
I'm new to Xcode and decided to give it a try, however, I'm unable to preview even the default "hello, world" message.
I've tried downloading Xcode on the App Store on Mac and from the official website, but I couldn't go pass the "Preparing (Automatic) iPhone Simulator."
I've also tried the following line of code on Terminal, but nada:
xcrun simctl erase all
Here's what I see for almost two hours now (it makes no sense):
My system specs:
iMac Retina 4K, 21.5-inch, 2019, 3 GHz Intel Core i5 6-Core, Radeon Pro 560X 4 GB, 8 GB 2667 MHz DDR4 (two 4gb core each), 1TB SSD.
I've coded way bigger web projects using various applications, but Xcode can't even preview the sample file?
Please, help. I would really like to code using Swift. :)
Hi all,
I got the email saying my certificate(s) will be expiring in 30 days.
I can view my certificates (distribution, distribution managed, and 2x developments) on my account page.
The distribution expires in 30 days (4/20/2023)
The distribution managed expires in 6 months
Development #1 (under my name) expires in 30 days (4/20/2023)
Development #2 (also under my name) expires in 2 months (5/26/2023)
However, I don't see any way to renew them.
I have read other posts that talk about 'edit' or 'generate' buttons, but I don't see that and I presume those posts are just out of date.
When I look in my xcode project, I see that I am using 'automatically manage singing'.
Xcode also shows that a provisioning profile is expiring in 2 months. I presume that is something different? It has the same expiration date as my development #2 certificate (5/26/2023).
It's also unclear what is going to happen when these certificates expire.
I read that devices running builds with the expired distribution cert will stop working.
Is that just for internal builds downloaded from something like Test Flight?
Will live builds, downloaded by actual players from the AppStore, stop working if I don't push a release with a new cert in the next month?
I am the one that set this all up and 'maintains' it, but I don't engage with it often enough to remember the bits and bobs.
My apologies for all the newbie questions.
Thank you for your assistance
Hi,
I need to access my private and public key that i have on my iPhone in folder that i named Keys. Directory is located On My IPhone. How can i access this directory? How do I know its path?
Please help.
Topic:
Developer Tools & Services
SubTopic:
Xcode