Post

Replies

Boosts

Views

Activity

Error with duplicate Device
I'm new to iOS development, although I've been through some basic tutorials. I never went as far as publishing an app. I hope what I describe makes sense to someone who has gone through the process. I was tasked with updating our iOS app as the previous developer is no longer with the company I was invited to the team by the admin so I have access to all devices/profiles/certificates in the dev portal. The problem: In the step of linking the UDID to this profile, an error occurs, this device identifier has been duplicated. Not sure how this is possible if I can't add one with the same UDID? So I disabled the two duplicates, thinking this would allow me to add the new entry. No, same error. And now, I can't even reactivate ANY of the other two that I previously deactivated because there is already a device with the same UDID in the list!
1
2
522
Jul ’23
Crash When Run app On Xcode15 Simulator
When UICollectionViewFlowLayoutAlertForInvalidItemSize Occured Some Log Like These Occurred, and then app crash *** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410 crash Output *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 16}, scale=3.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'
31
6
22k
Jul ’23
Incorrect image alpha rendering on Xcode 15b3 and iOS 17
I'm not sure if I'm changed an unknown-to-me setting somewhere, but since this morning, after profiling an app (metal, allocations, etc), every project I run/build on Xcode 15b3, either on simulator or on device, displays partially-alpha images blended to black, as if there was some problem in the process of compiling the PNGs (lack of premultiplying, color space, etc). If I open those same projects on Xcode 14, they are displayed everything as they should. Also, If I open them on other computers with Xcode 15b3 other than mine, it also works fine. And it was working fine for me this morning as well, but not anymore. I've tried uninstalling Xcode beta and the simulator a few times, cleaning folders and preferences, hoping it was some setting I changed by mistake with some hotkey, but no luck so far. I'll attach two pictures, one from Xcode 14, and the other one from Xcode 15b3, hoping it's some silly thing I'm missing. xc15b3: xc14:
21
5
5.2k
Jul ’23
Metrickit opt in rate and actual crash numbers dont match
The crash data opt in rate is 36% for my app. I have another crash reporting framework PLC in the app. The total number of crashes reported by MetricKit health report was 43% of the total crash count from PLC in May. This almost matched the 36% opt in rate. In the month of June we fixed a series of crashes. Now the total number of crashes reported by MetricKit health report is 80% of the total crash count from PLC. The crash data opt in rate has stayed at 36% for the past 90 days and I am not able to understand how the ratio flipped from 43% to 80%. Looking for guidance here.
5
0
1.6k
Jul ’23
Any better way to write multi-family Widget #Preview macro?
Hello, In WidgetKit, I have to write multiple #Preview macros for each family the widget supports. So is there any better way to write the #Preview? (Although I can use the legacy PreviewProvider but it does not support timeline to test transition animation.) #import WidgetKit #import SwiftUI struct DailyCaffeineWidget: Widget { ... } @available(iOS 17.0, *) #Preview("Inline", as: .accessoryInline) { DailyCaffeineWidget() } timelineProvider: { previewTimelineProvider() } @available(iOS 17.0, *) #Preview("Circular", as: .accessoryCircular) { DailyCaffeineWidget() } timelineProvider: { previewTimelineProvider() } @available(iOS 17.0, *) #Preview("Rectangular", as: .accessoryRectangular) { DailyCaffeineWidget() } timelineProvider: { previewTimelineProvider() } @available(iOS 17.0, *) #Preview("Small", as: .systemSmall) { DailyCaffeineWidget() } timelineProvider: { previewTimelineProvider() } @available(iOS 17.0, *) #Preview("Medium", as: .systemMedium) { DailyCaffeineWidget() } timelineProvider: { previewTimelineProvider() } ...
2
2
1.7k
Jul ’23
no exact matches in reference to static method 'buildExpression'
This error ( no exact matches in reference to static method 'buildExpression' ) keeps occurring in my content view on the line that states .environmentObject(registrationViewModel). Here is the ContentView code: import SwiftUI struct ContentView: View { @StateObject var viewModel = ContentViewModel() @StateObject var registrationViewModel = RegistrationViewModel() var body: some View { Group { if viewModel.userSession == nil { LoginView() .environmentObject(registrationViewModel) } else if let currentUser = viewModel.currentUser { MainTabView(user: currentUser) } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } Here is the RegistrationViewModel code: import Foundation class RegistrationViewModel: ObservableObject { @Published var username = "" @Published var email = "" @Published var password = "" func createUser() async throws { try await AuthService.shared.createUser(email: email, password: password, username: username) } } Here is some more info about the error: Candidate requires that 'some View' conform to 'CustomizableToolbarContent' (requirement specified as 'Content' : 'CustomizableToolbarContent') Candidate requires that 'some View' conform to 'CustomizableToolbarContent' (requirement specified as 'Content' : 'CustomizableToolbarContent') Candidate requires that 'some View' conform to 'TableRowContent' (requirement specified as 'Content' : 'TableRowContent') Candidate requires that 'some View' conform to 'Commands' (requirement specified as 'Content' : 'Commands') I have been trying to figure out this error for 2 days! Please help! Thanks
2
0
2.7k
Jul ’23
Xcode 15 doesn't fix Info.plist management bugs introduced in Xcode 14
Xcode 14 introduced some ridiculous Info.plist management bugs which are not yet fixed in Xcode 15: The bugs are manifested in the General and Info tabs of target management: -The Build value in the General tab is not in sync with the CFBundleVersion value in the Info tab (that is, changing the value in the General tab won't affect the Info tab and vice versa). -The App Category value in the General tab isn't in sync with the LSApplicationCategoryType value in the Info tab. -Additional document type properties in the Info tab cannot be added: clicking "Click here to add..." doesn't do anything. -Document types in Info tab cannot be deleted: once you added a document type instance (even as a test) there's no way to remove it.
3
0
2.3k
Jul ’23
SwiftData Fatal error: failed to find a currently active container
I'm new to Apple development and decided to learn using SwiftData and Xcode 15 beta 4 (though I'm starting to think I don't need that extra challenge). I've worked through many issues--with you all's help--but this is one I can't figure out and hasn't shown up in my searches. I'm working on the traditional task list app (with a Task model). I've tried several approaches to app structure, but each time I eventually hit this same error. It doesn't happen when I set up the new Xcode project, but eventually it does. I've cleaned the build folder, restarted the Simulator, and even rebooted the Macbook I'm working on. Here's what happens when I click Product > Run: the app builds successfully the Simulator displays a white screen as expected then the error appears. Here are the error messages: In the debug area it says: SwiftData/ModelContainer.swift:159: Fatal error: failed to find a currently active container for Task Failed to find any currently loaded container for Task) and in the warning in the editor says Thread 1: Fatal error: failed to find a currently active container for Task The debugger is highlighting this line in the call stack (not sure if that's useful as a newbie): #7 0x0000000100bb6d90 in Task.init(id:title:priority:) at /var/folders/3v/q8g4z9bx4lb9z6t7mhgwgghw0000gn/T/swift-generated-sources/@__swiftmacro_10BadgerTool4Task5ModelfMm_.swift:2 Here's the code: The Task model isn't complex: // Task.swift import Foundation import SwiftData @Model class Task { @Attribute(.unique) var id: UUID var title: String var priority: String init(id: UUID = UUID(), title: String, priority: String = "None") { self.id = id self.title = title self.priority = priority } } I have the model container set in the context of the highest view: // BadgerToolApp.swift import SwiftUI import SwiftData @main struct BadgerToolApp: App { var body: some Scene { WindowGroup { NavView() .modelContainer(for: Task.self) } } } I tried moving all other views one layer down (which is why the unnecessary NavView is there): // NavView.swift import SwiftUI import SwiftData struct NavView: View { @State var selectedCollection: Collection? @State var selectedTask: Task? var body: some View { NavigationSplitView( sidebar: { SideBarView(selectedCollection: $selectedCollection, selectedTask: $selectedTask) }, content: { ContentListView(selectedCollection: $selectedCollection, selectedTask: $selectedTask) }, detail: { TaskDetailView(selectedCollection: $selectedCollection, selectedTask: $selectedTask) } ) } } Trying to isolate my mistake I removed everything else related to SwiftData (except for the imports) and gave my views hard-coded data for the simulator like this: // SideBarView.swift import SwiftUI import SwiftData struct SideBarView: View { @Binding var selectedCollection: Collection? @Binding var selectedTask: Task? let collections = presetCollections //temp data var body: some View { List(collections, id: \.id, selection: $selectedCollection){ collection in NavigationLink(collection.name, value: collection) } List{ Text("All Tasks") Text("Settings") } .navigationTitle("Collections") } } Everything works as expected if I comment out the .modelContainer() modifier on the call to NavView view I change the Task definition from the @Model class to a regular struct like this: // Task.swift // with @Model removed import Foundation struct Task: Hashable { var id: UUID var title: String var priority: String init(id: UUID = UUID(), title: String, priority: String = "None") { self.id = id self.title = title self.priority = priority } } What am I missing? Could it be a bug? Thanks for your help!
12
4
11k
Jul ’23
Upvoting own post dilemma.
Users can upvote their own posts, yet they don't by default upon posting them. Reddit, for comparison, continues to allow users to remove their own-post upvotes, but upvotes them for the user by default. Other forums like Stack Overflow disallow own-post upvoting. This forum has the worst of both worlds, for users can gain an algorithmic advantage by upvoting their own. It might seem like a minor issue, because it is. But it's an issue in my eyes regardless.
5
2
1k
Jul ’23
Warning when archiving product in Xcode with AppIntent extension
When building my app for debugging in Xcode I don't get any warning, only when archiving the product: MyIntent.appex is an ExtensionKit extension and must be embedded in the parent app bundle's Extensions directory, but is embedded in the parent app bundle's ../../../BuildProductsPath/Release/MyApp.app/Contents/Extensions directory. The MyIntent.appex is listed in the main target's Frameworks, Libraries and Embedded Content section and its Build Phase Embed ExtensionKit Extensions with Destination ExtensionKit Extensions. The extension also seems to work, since the app intent is correctly listed in the Shortcuts app. Is this an Xcode bug or do I need to do something different?
2
1
888
Jul ’23
Error reporting test coverage in Xcode 14.3.1
Xcode is throwing an error when attempting to report test coverage after running unit tests. Showing All Messages Failed to merge raw profiles in directory /{my project dir}/DerivedData/{my project name}/Build/ProfileData/A98EC493-3AB4-4B1C-B7FC-BC5D77B23EE3 to destination /{my project dir}/DerivedData/{my project name}/Build/ProfileData/A98EC493-3AB4-4B1C-B7FC-BC5D77B23EE3/Coverage.profdata: Aggregation tool '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/llvm-profdata' failed with exit code 1: warning: /{my project dir}/DerivedData/{my project name}/Build/ProfileData/A98EC493-3AB4-4B1C-B7FC-BC5D77B23EE3/997F01E3-3735-4897-AE00-31EBB0A9E8D3-57885.profraw: invalid instrumentation profile data (file header is corrupt) error: no profile can be merged Anyone else seeing this issue?
12
1
3.6k
Jul ’23
Apple Watch cannot reconnect
None of my existing apps (both in-AppStore and in-development) nor even a brand new WatchOS app can be installed to my Apple Watch. While using Xcode to build and deploy to my Watch, I get this: ”Waiting to reconnect to Apple Watch Xcode will continue when the operation completes.” However, this dialog persists and never completes. I’m running all of the latest: MacOS 14 beta 4, Xcode 15 beta 5, Watch OS 10 beta 4, iOS 17 beta 4. I’ve tried resetting my Watch (with “Erase All” option) and restarting the Mac, the phone and the watch. Any help?
38
15
15k
Jul ’23
Interface is not propagated when using mergeable libraries
Hi! I've been dealing with mergeable libraries quite some time. However I can't achieve the following scenario: I have 2 xcframeworks A and B that are merged as part of a third xcframework called C. And my app needs to import something from A and B. As per the documentation we have to remove the references from A and B from the final app and replace it with C. If I work on the same xcodepoj it works like a charm (maybe because of caches), but if I try to compile C as a separate XCFramework and distribute it as a packed library, the app is not able to resolve the symbols to A and B classes. This C xcframework is compiled with BUILD_LIBRARY_FOR_DISTRIBUTION se to true and if I check its swiftinterface files it is not declaring the symbols from A and B. However the size of the binary seems to have A and B. Is there any way to export A and B symbols as part of C's swiftinterface? If I add @_exported, it is forcing me to declare the import of A and B wherever I use them and therefore I'm going to have duplicated symbols Thanks!
2
0
865
Aug ’23
Third-party SDK's privacy report are not shown when 'Generate Privacy Report' button tapped.
In Xcode 15, when performing an Archive build and clicking the 'Generate Privacy Report' button, it is believed that the app creates a PrivacyReport PDF file by inspecting the PrivacyInfo.xcprivacy file used by the Third-party SDKs within the app. However, upon testing, it appears that only the PrivacyInfo.xcprivacy file from the app itself is included in the generated PDF, and the PrivacyInfo.xcprivacy file from Third-party SDKs is not being included. For example, I placed the PrivacyInfo.xcprivacy file inside the 'MyFramework' project and created an xcframework with it. Then, I added MyFramework.xcframework into the TestApp and clicked the 'Generate Privacy Report' button after an Archive build, I encountered an error saying, 'The archive does not contain any PrivacyInfo.xcprivacy files.' (Of course, the added xcframework is already included in the TestApp target.) If you know the solution, please help me out.
8
5
7k
Aug ’23