I'm running into an undocumented error coming back from CloudKit operations.
Specifically, I'm attempting to save new records via CKModifyRecordsOperation. I'm receiving this error for each of the records in the perRecordSaveBlock callback:
<CKError 0x3018ac3c0: "Internal Error" (1/3001); "MMCSEngineCreate failed">
Is anyone else facing this error? It has been happening for several days and I'm finally getting around to reproduction with the Console app and logs. I have 16 records on my device locally that each one gets this error back.
FB16547732 - CloudKit: CKModifyRecordsOperation saving new records results in Error <CKError 0x3018ac1e0: "Internal Error" (1/3001); "MMCSEngineCreate failed">
Overview
Post
Replies
Boosts
Views
Activity
I read the documentation and it told I had to prepare the product on App Store connect and once it is at the state "Ready to submit" I could access it on a phone where I am connected with an Icloud account in the developper list of the apple development account.
This is what I've done but when I try to fetch in my flutter code the product with the id I set in App Store connect it says "No product found"
Here is where I fetch the product:
Future purchaseProduct(String productId) async {
try {
Set<String> _pIds = {productId};
final ProductDetailsResponse response =
await _iap.queryProductDetails(_pIds);
if (response.productDetails.isEmpty) {
throw 'Product not found';
}
final ProductDetails productDetails = response.productDetails.first;
final PurchaseParam purchaseParam =
PurchaseParam(productDetails: productDetails);
_iap.buyConsumable(purchaseParam: purchaseParam);
} catch (e) {
Services.debugLog('Error purchasing product: $e');
throw e;
}
}
I checked the product ID and it does not seems to be the problem. Is there some other steps I need to do ?
I am attempting to use the AVSpeechSynthesizer to include text to speech in my Swift Playgrounds project, but when I attempt to use it on my IPhone i get the following errors:
It works just fine on the simulator, but no audio is produced when I run it on-device. Is there a way to set this "bundle display name" within Swift Playgrounds, or are there any workarounds?
My code:
import AVFoundation
class Speaker {
let synthesizer = AVSpeechSynthesizer()
func speak() {
let utterance = AVSpeechUtterance(string: "Test, I am the speaker")
synthesizer.speak(utterance)
}
}
I am running into some issues when trying to destroy CoreData persistentStores. When a user logs out of my app, I want to completely reset CoreData and delete any existing data. My code to reset CoreData looks like this:
let coordinator = self.persistentContainer.persistentStoreCoordinator
self.persistentContainer.viewContext.reset()
coordinator.persistentStores.forEach { store in
guard let url = store.url else { return }
do {
try coordinator.destroyPersistentStore(at: url, type: .sqlite)
_ = try coordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: url)
} catch {
print(error)
}
}
However, my app is crashing with
Object 0xb2b5cc80445813de <x-coredata://BDB999D4-49A4-4CB3-AC3A-666AD60BEFC6/AccountEntity/p5> persistent store is not reachable from this NSManagedObjectContext's coordinator
It seems this is related to the SwiftUI @FetchRequest wrappers. If I do not open the views where I am using @FetchRequest, the logout goes smoothly. Otherwise, I get the crash above.
Has anyone run into anything similar? Is there something else I need to do to get the underlying FRC to release its references to those entities? I was under the impression that calling reset() on the managed object context would be enough to remove those items from memory and get the destroying of the persistent store to go smoothly.
Alternately, is there another/better way I should be destroying the DB?
Any advice or related observations would be greatly appreciated. Thank you!
Hi,
You're here because your project has issues related to Xcode Previews or Swift Previews. The issue you're experiencing may be the result of any of the following:
An error in your SwiftUI app, Xcode previews, or on-device previews.
A configuration error in your Xcode project, including any third-party dependencies or packages.
A system issue in the operating system, SwiftUI, or in Xcode Previews.
Based on your request, I need more information about your SwiftUI app when rendering Xcode Previews or on-device previews. Specifically, I’ll need the diagnostics Swift Previews generates to make sure I understand the error encountered by the preview system. Please create a report in Feedback Assistant to share the details requested in the instructions below.
For issues with macOS, Mac Catalyst, or on-device iOS previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error while previewing on device, taking note of the timestamp when the error occurred.
Attach the Xcode sysdiagnose, sysdiagnose, or simctl diagnose logs and timestamp to your feedback.
For issues with Xcode Previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error in Xcode Previews, if you haven’t already done so.
If an error banner appears in the canvas, click the "Diagnostics" button within the banner, then go to Step 5; otherwise, continue to Step 4.
If the error banner is missing, navigate to the menu in Xcode: Editor > Canvas > Diagnostics
In the presented sheet, click the "Generate Report" button.
Attach a zip file containing the diagnostic report to your bug report (it will be named something like previews-diagnostics-0123456789.zip).
Submitting your feedback
Before you submit to Feedback Assistant, please confirm the following information is included in your feedback:
For Swift Previews
Xcode, system, or simctl diagnose logs, with Swift Previews logging profile, gathered after reproducing the issue
timestamp identifying when the issue was reproduced
focused sample Xcode project that reproduces the issue (if applicable)
screenshots or videos of the error (optional)
For Xcode Previews
Xcode Previews diagnostics report with Swift Previews logging profile, gathered after reproducing the issue
timestamp identifying when the issue was reproduced
focused sample Xcode project that reproduces the issue (if applicable)
screenshots or videos of the error (optional)
Please include all requested information to prevent delays in my investigation.
After your submission to Feedback Assistant is complete, please respond to your original Forums post with the Feedback ID. Once received, I can begin my investigation and determine if this issue is caused by an error within your SwiftUI app, a configuration issue within your Xcode project, or an underlying issue in the operating system, SwiftUI, in Xcode Previews, or on-device previews.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
I'm getting this error when uploading a build of my macOS app to App Store Connect. It has always worked before, and nothing changed about my use of app groups, and the iOS build uploaded without any problems. Cleaning the build folder and derived data folder doesn't help. I'm using automatically managed signing in Xcode.
Invalid code signing entitlements. Your application bundle’s signature contains code signing entitlements that aren’t supported on macOS. Specifically, the “[group.]” value for the com.apple.security.application-groups key in “.pkg/Payload/.app/Contents/MacOS/” isn’t supported. This value should be a string or an array of strings, where each string is the “group” value or your Team ID, followed by a dot (“.”), followed by the group name. If you're using the “group” prefix, verify that the provisioning profile used to sign the app contains the com.apple.security.application-groups entitlement and its associated value(s).
I've recently upgraded to Xcode 16 and noticed a change in how the Tab key functions during autocomplete.
(not-replied-but-closed post: https://discussions.apple.com/thread/255762888)
Previously, pressing Tab would extend the typed text up to the first point of choice.
For example, we have two classes: NSViewController and NSViewCoordinator
BEFORE, typing: "NSV" + Tab used to complete to NSViewCo
Now, in Xcode 16, pressing Tab selects the first suggestion by default, instead of completing up to the choice point.
That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually.
Seems there is no way to restore the previous behavior and that looks very very sad.
I have reverse engineered Xcode 16...and what I get?
They just install new CodeCompletion handler instead of old one without any chance to configure this behaviour by settings or UserDefaults =\
Hope this thread would raise votes and attract Xcode devs here
I have a SwiftUI View I've introduced to a UIKit app, using UIHostingController. The UIView instance that contains the SwiftUI view is animated using auto layout constraints. In this code block, when a view controller's viewDidAppear method I'm creating the hosting controller and adding its view as a subview of this view controller's view, in addition to doing the Container View Controller dance.
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let hostingViewController = UIHostingController(rootView: TestView())
hostingViewController.view.translatesAutoresizingMaskIntoConstraints = false
addChild(hostingViewController)
view.addSubview(hostingViewController.view)
let centerXConstraint = hostingViewController.view.centerXAnchor.constraint(equalTo: view.centerXAnchor)
let topConstraint = hostingViewController.view.topAnchor.constraint(equalTo: view.topAnchor)
widthConstraint = hostingViewController.view.widthAnchor.constraint(equalToConstant: 361)
heightConstraint = hostingViewController.view.heightAnchor.constraint(equalToConstant: 342)
NSLayoutConstraint.activate([centerXConstraint, topConstraint, widthConstraint, heightConstraint])
hostingViewController.didMove(toParent: self)
self.hostingViewController = hostingViewController
}
I add a button to the UI which will scale the UIHostingViewController by adjusting its height and width constraints. When it's tapped, this action method runs.
@IBAction func animate(_ sender: Any) {
widthConstraint.constant = 120.3
heightConstraint.constant = 114.0
UIView.animate(withDuration: 0.5) {
self.view.layoutIfNeeded()
}
}
The problem is, the SwiftUI view's contents "jump" at the start of the animation to the final height, then animate into place. I see this both using UIView.animate the UIKit way, or creating a SwiftUI animation and calling `UIView.
What else do I need to add to make this animate smoothly?
My team has reached the maximum number of registered iPhone devices on our profile and would like to reset the list to remove those that are no longer valid. Currently, our reset date in the developer portal shows March 22nd as the earliest date for a reset. Is it possible to request an earlier reset date?
Thanks
I've been contacting Apple Developer support since last Friday because I am trying to open an individual apple developer account. I have opened 2 or 3 tickets and tried paying the $99 fee 2 times, 2 times I wasn't charged at all. I haven't got any reply to the support tickets and I don't know what to do...
my request id 102537013023
Failed to verify your identity. Try again.
@IBOutlet weak var surnameTextField: UITextField!
surnameTextField.backgroundColor = UIColor.clear
surnameTextField.tintColor = .white
surnameTextField.textColor = .white
surnameTextField.attributedPlaceholder = NSAttributedString(string: surnameTextField.placeholder!, attributes: [NSAttributedString.Key.foregroundColor: UIColor(white: 1.0, alpha: 0.6)])
let bottomLayersurname = CALayer()
bottomLayersurname.frame = CGRect(x: 0, y: 29, width:1000, height: 0.6)
bottomLayersurname.backgroundColor = UIColor.lightGray.cgColor
surnameTextField.layer.addSublayer(bottomLayersurname)
Hello! I'm use AVFoundation for preview video and audio from selected device, and I try use AVAudioEngine for preview audio in real-time, but I can't or I don't understand how select input device? I can hear only my microphone in real-time
So far, I'm using AVCaptureAudioPreviewOutput for in real-time hear audio, but I think has delay.
On iOS works easy with AVAudioEngine, but on macOS bruh...
Hello togehter,
i do have the following question.
If I have my App run in landscape mode and a sheet view get's called, will it be possible to switch automatically from landscape mode in portrait mode and fix this device orientation?
Once the sheet view get's dismissed or closed, the original view will come back and the device orientation shall switch back to landscape mode.
Thanks you so much for your help!
My phone Apple ID not log in type for log in failed
Hello ladies and gentlemen, I'm writing a simple renderer on the main actor using Metal and Swift 6. I am at the stage now where I want to create a render pipeline state using asynchronous API:
@MainActor
class Renderer {
let opaqueMeshRPS: MTLRenderPipelineState
init(/*...*/) async throws {
let descriptor = MTLRenderPipelineDescriptor()
// ...
opaqueMeshRPS = try await device.makeRenderPipelineState(descriptor: descriptor)
}
}
I get a compilation error if try to use the asynchronous version of the makeRenderPipelineState method:
Non-sendable type 'any MTLRenderPipelineState' returned by implicitly asynchronous call to nonisolated function cannot cross actor boundary
Which is understandable, since MTLRenderPipelineState is not Sendable. But it looks like no matter where or how I try to access this method, I just can't do it - you have this API, but you can't use it, you can only use the synchronous versions.
Am I missing something or is Metal just not usable with Swift 6 right now?
I am using C APIs for XPC communication.
When my XPC server gets a xpc_dictionary as a message, I use xpc_dictionary_get_string to get the string which is of type const char*. Afterwards, when I try to free up the memory for the string, I get an error.
I could not find any details on why this happens.
Does XPC handle the lifecycle of these C strings ?
I did some tests to see the behaviour.
The following code snippet prints a string temp before and after releasing the dictionary memory.
char* string = "dummy-string";
xpc_object_t dict = xpc_dictionary_create(NULL, NULL, 0); xpc_dictionary_set_string(dict, "str", string);
const char* temp = xpc_dictionary_get_string(reply, "str");
printf("temp before release: %s\n", temp);
xpc_release(reply);
printf("temp after release: %s\n", temp);
output:
# temp before release: dummy-string
# temp after release:
I tried to free the variable temp before and after releasing dict .
char* string = "dummy-string";
xpc_object_t dict = xpc_dictionary_create(NULL, NULL, 0); xpc_dictionary_set_string(dict, "str", string);
const char* temp = xpc_dictionary_get_string(dict, "str");
printf("temp before release: %s\n", temp);
free((void *)temp); // case 1
xpc_release(dict);
// free((void *)temp); // case 2
printf("temp after release: %s\n", temp);
in both the cases i got the output:
# temp before release: dummy-string
# app(18502,0x1f02fc840) malloc: Double free of object 0x145004a20
# app(18502,0x1f02fc840) malloc: *** set a breakpoint in malloc_error_break to debug
# SIGABRT: abort
# PC=0x186953720 m=0 sigcode=0
# signal arrived during cgo execution
# ...
# ...
hi so im trying to create a simple app that has two pressable buttons that turn a spa mode on and off wishing another app
so far I have the UI figured out the app works the only issue is right now when I press spa on I have setup so it opens Siri Shortcuts and enables the shortcut is there a way to make the app revert back to mine after the action is done? or is there another way to open the other app and navigate to the button within that app and enable it behind my app
Hi all. I don't know where else to go in order to find a way to communicate with Apple or reach help.
I have enrolled to the Apple Developer Product, no money charged in my account by I have received confirmation of Apple Acknowledgement that I have made an order.
Specifically 2 weeks now I try to contact someone from Apple side but with no luck. Recently I received the following and I had a small conversation from them.
If you have additional questions related to this request, please > reference case number 20000089031868.
Ge***le -> this is the name of the support agent
Did I do something wrong from my side? Does anyone has the same issue?
I am experimenting with Swift Testing and Xcode Cloud and would like to write some tests that require to use MusicKit functionality. For example I'd like to fetch an album via MusicCatalogRessourceRequest to test an initializer of another struct.
However this test fails because the permission to access the music library is not granted. Once the permission is granted, the test works as expected.
Things I have tried:
Add NSPrivacyAccessedAPITypes to the Info.plist. This did not show any effect. Below is the corresponding snippet
Trying to tap the button programmatically. Once again this did not show any effect.
The Info.plist snippet:
<key>NSPrivacyAccessedAPITypes</key>
<array>
<string>NSPrivacyAccessedAPIMediaLibrary</string>
</array>
The code snippet to tap the button:
let systemAlerts = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let allowButton = systemAlerts.buttons["Allow"]
if allowButton.exists {
allowButton.tap()
}
What am I doing wrong here? I need access to MusicKit functionalities to write meaningful tests. Thank you