I've added a package to my Mutliplatform project (Shout) that is now causing an error. When I attempt to build my program on my MacOS Ventura I get a warning "Could not find or use auto-linked library zlib" and six errors about undefined symbols from the zlib library: _deflate, _deflateEnd, _deflateInit_, _inflate, _inflateEnd, and _inflateInit_
I've added paths to my target's Build Settings under Library Search Paths and it doesn't seem to help.
Has any one seen anything like this and can help me build the project?
It was working with the previous version of my app on the previous stable version. I am running the beta Ventura with the new Xcode version and started a new app to move my code over in parts.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am currently running Xcode Version 14.0 beta (14A5228q) creating a Multiplatform app. I wanted to include a LaunchScreen so added a Launch Screen Storyboard to my project. To the the app to see it I went under Target for my app, General, and under App Icons and Launch Screen I set the Launch Screen File to my storyboard.
This works perfectly when I run the app on iOS; however, when I run it on macOS I get an error:Launch Screen.storyboard error build: iOS storyboards do not support target device type "Mac".
I see there's no way to differentiate between macOS and iOS with the file and there's only one target. Does anyone know a way to make the storyboard only launch when running the iOS app (and iPadOS) and not be seen when running macOS?
Thanks
Yesterday I had issues with my CoreData database for my Multiplatform app which resulted in changes to the schema. I reset the CloudKit version and, on the iOS simulator, had to delete my app and run the code again to get it to work. My issue is with the macOS target. I'm getting the same fatalError (Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 "Persistent store migration failed, missing mapping model.") when running the macOS app but I can't figure out how to delete it so I can run it fresh like I did with the iOS version.
I've found where the application is created (in the Debug directory ultimately within my app's Build directory) and removed them all but when run the newly created application has the same error. Should I move up the directory structure and remove the entire app directory within Xcode/DerivedData or is there another way? Wanted an answer before I do something I can't go back from :)
Thanks,
Kyra
I'm currently hooking up StoreKit2 to my app. I worked my way through an older example that listened to products and added/removed ids as they came up. This example fell short using the StoreKit config file as all subscriptions don't have a revocation date set so my list of purchased ids just grew longer (as they weren't removed).
My app is only using a single subscription group and thus will only have one subscription live at once. I'm currently grabbing the current subscription using for await result in Transaction.currentEntitlements and am showing the subscriptions with StoreView(ids: arrayIds) and SubscriptionStoreView(groupID: subscriptionGroupID) depending where they user is. Currently when those views disappear I grab the current subscription again (thus updating it if it was changed). That seems cumbersome especially if it doesn't need to be updated and I'm not getting the following error: Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch..
I'm wondering if there's a way to just listen to the StoreKit Subscription ID in my main App entry point thus making the final error disappear and maybe, if I could update the type of subscription, removing my onDisappear subscription fetches throughout the rest of the app.
All the examples I come across seem to be either tied up with SwiftData (WWDC 2023) or older and maybe not applicable anymore. Everything seems to be embedded in StoreKit and it would be lovely if I could listen in one simple spot for in app and outside app subscription changes.
Thanks :)
I'm working on hooking up a Multiplatform app with CloudKit (using CoreData) and I was wondering if anyone knows any current tutorials to help me understand the process better?
I was trying to wrap my head around the WWDC 2022 tutorial CoreDataCloudKitDemo but it isn't SwiftUI and I'm getting bogged down by the non-relevant code.
Thanks everyone :)
During one of the WWDC talks this year I remember hearing that when a user clicks cancel on an edit form you should show an alert warning them about discarding the changes before leaving. YET if there aren't any changes we should just exit when canceled.
Looking back at that I wonder how do you know if there are no changes? Right now I load the Core Data Entity fields on my page and set them one by one on save. Is there a better way that would also make it easier to know when to leave and when to warn when canceling? Are there any examples of this?
Thanks everyone.
Hey,
I'm coding my app in the Xcode Beta 2 and am attempting to access the HKHealthStore() to add a HKCategorySample. When I run the app and attempt to add the sample I get the following error:
Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo={NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}
When I make sure to requestAuthorization before running the code I get a different error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthShareUsageDescription must be set in the app's Info.plist in order to request read authorization for the following types: HKCategoryTypeIdentifierMindfulSession'
I'm assuming I need to add to my Info.plist but am unable to figure out how. If I go to my project or project's target and access Build Settings I see the following image:
But am unable to edit it. I assuming I want to add NSHealthShareUsageDescription with a String explanation for why I want access but anything I find online is for an older Xcode so I don't know how to do it.
Any help to get this working would be really appreciated. Thank you
I have a multiplatform app that I'm coding that uses HealthKit. To get it working I needed to add a custom entitlement to the entitlements file. Specifically "application-identifier". See this solved question for more information: https://developer.apple.com/forums/thread/713829
Now I can only run the app on my simulators and NOT on my phone or Mac as the automatic signing is failing
Provisioning profile "iOS Team Provisioning Profile: myName.AppName" doesn't match the entitlements file's value for the application-identifier entitlement.
It says to submit a bug report:
Automatic signing failed. Xcode failed to provision this target. Please file a bug report at <https://feedbackassistant.apple.com> and include the Update Signing report from the Report navigator.
Which I did FB11512832, but is there something I can do to fix this or is it just a wait and see?
Error image:
I'm attempting to figure out how to display a message to my users when some asynchronous code takes some time to run. So far I've used a sample I found online to create a popup banner and tied the message together using an ObservedObject of the async method on my view and Publishing the values.
My sample code project is on a public GitHub repository here. https://github.com/SimplyKyra/CodeAttempts
Right now I have an issue as when I set the variables in the async method I'm getting the following error: Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates. Solutions online seem to fix this issue by updating the value on the @mainActor thread but I want these methods to run asynchronously AND update the user on what's happening. What's the best way to update my variables from this location?
Hi. I’m developing a multiplatform app for both iOS and macOS and was wondering if there’s any way to display an SVG file in the swiftUI view. I’ve seen ways online once you put the image in the assets file but this will be dynamic coming from outside the program.
I just want to display and maybe rotate it but nothing more complicated than that.
thanks
I'm developing a Multiplatform app that uses CloudKit to sync the CoreData between the user's devices. At this time they don't share data between users. I have a single password field on a single Entity and was wondering if there was a simple way to encrypt just this field. I see in CoreData there's a checkbox labelled "Allows Cloud Encryption"... does checking that off magically encrypt it. I checked it off and nothing seemed to change so I unchecked it for now... is there something else I needed to do? And, most importantly, will it work with CloudKit?
Hi,
I'm updating my app from CoreData to SwiftData and came across an issue. My app has multiple users so in CoreData and I assigned each a myID value set to an UUID so I could use UserDefaults to set the preferred user on app load. When switching over I noticed the PersistentIdentifier value and got excited as I could fetch the matching entity with modelContext.model(for: yourID). I decided to use that instead so I updated my UserDefaults code from UUID to this:
@Published var selectedUserID: PersistentIdentifier? {
didSet {
UserDefaults.standard.set(selectedUserID, forKey: "selectedUserID")
}
}
init() {
self.selectedUserID = UserDefaults.standard.object(forKey: "selectedUserID") as? PersistentIdentifier ?? nil
}
This code compiles and, of course the id is currently set to nil. My issue now is when I try to assign a user to it ar my app crashes and I get the following error:
Attempt to set a non-property-list object SwiftData.PersistentIdentifier(id: SwiftData.PersistentIdentifier.ID(url: x-coredata://6FE80FC9-0B4C-491E-8093-DED37A619F1B/EnteredUser/p834), implementation: SwiftData.PersistentIdentifierImplementation) as an NSUserDefaults/CFPreferences value for key selectedUserID
Should I go back to an additional UUID field in my user model and find it that way or is there a way to use the PersistentIdentifier value with my UserDefaults?
Thanks for any tips.
I have a bug I've come across since I've upgraded Xcode (16.0) and macOS (15.0 Sequoia) and figured I'd create a minimal viable example in case someone else came across this and help. I've noticed this in both the macOS and iOS version of my app when I run it.
Essentially I have an area of my code that calls a class that has a step 1 and 2 process. The first step uses async let _ = await methodCall(...) to create some SwiftData items while the second step uses a TaskGroup to go through the created elements, checks if an image is needed, and syncs it. Before this worked great as the first part finished and saved before the second part happened. Now it doesn't see the save and thus doesn't see the insertions/edits/etc in the first part so the second part just isn't done properly. Those step one changes are set and shown in the UI so, in this case, if I run it again the second part works just fine on those previous items while any newly created items are skipped.
I came across this issue when step one handled 74 inserts as each one didn't contain an image attached to it. When I switched the async let _ = await methodCall(...) to a TaskGroup, hoping that would wait better and work properly, I had the same issue but now only 10 to 30 items were created from the first step.
Minimal Viable Example: to reproduce something similar
In my minimal viable sample I simplified it way down so you can't run it twice and it's limited it creating 15 subitems. That said, I've hooked it up with both an async let _ = await methodCall(...) dubbed AL and a TaskGroup dubbed TG. With both types my second process (incrementing the number associated with the subissue/subitem) isn't run as it doesn't see the subitem as having been created and, when run with TaskGroup, only 12 to 15 items are created rather that the always 15 of async let.
Code shared here: https://gist.github.com/SimplyKyra/aeee2d43689d907d7a66805ce4bbf072
And this gives a macOS view of showing each time the button is pressed the sub issues created never increment to 1 while, when using TaskGroup, 15 isn't guaranteed to be created and remembered.
I'm essentially wondering if anyone else has this issue and if so have you figured out how to solve it? Thanks
Hi,
First year receiving revenue through Storekit subscriptions. I live in the United States and know I need to pay taxes within the U.S. for my revenue. I'm curious if I have to handle anything (taxes, etc) in each country I sold a subscription in or does Apple handle all that for me? If it's a per-country basis is there a list somewhere so I can use it to choose where I should offer my app in the future?
Thanks everyone!
Hey everyone!
I'm starting a new Multiplatform application with Core Data and CloudKit checked off. Before continuing I want to make sure the data is persisting between devices BUT can't figure out how to test that with the simulator. I can run the app on my Mac (under my apple account), can't run it on my phone (didn't download the beta), and when I try to log into the simulator with my Apple ID it gives me a "Verification Failed - An unknown error occurred". How do you test synced data between simulated devices???