I'm trying to update to 15 beta 2 a brand new iPad Pro 12.9 running 14.5.1, from a brand new M1 MBAir running Monterrey beta 2 (for M1 Macs), and it was "updating" for a couple of hours. I gave up and then downloaded & installed "Device Support for iOS 15" - and tried again. Same results. I see that there's a known issue regarding the 11" iPad Pro - but does anyone have any suggestions for me?
I do have a 2020 iMac that's running Big Sur 11.4 - should I attempt the update from there?
Post
Replies
Boosts
Views
Activity
The following app builds, but causes a runtime crash when trying to execute on an iOS 14.7 device. Using Xcode 13b5, macOS Monterey b5, iOS 15.b6 & iOS 14.7
import SwiftUI
struct ContentView: View {
@State private var text = "This app causes a runtime error on ios 14.7"
@available(iOS 15.0, *)
@FocusState var isInputActive: Bool
var body: some View {
if #available(iOS 15.0, *) {
TextEditor(text: $text)
.focused($isInputActive)
} else { // ios14 or <
TextEditor(text: $text)
}
}
}
Over the past few days, my experience with CloudKit Console has been terribly frustrating... recurring http timeouts, 502 Bad Gateways, and - worst of all - I've got an app which is posting to CloudKit via CoreData and although it DOES sync the data between my devices - CKConsole fails to show ANY records in the specified database... (I've even gone so far as to check BOTH public and private databases, in EACH of the CK Containers associated with my AppleID - desperately hoping to find these records via CKConsole - but alas, no such luck.)
Has anyone built an app (or MacOS application) which mirrors (and more importantly, improves upon) the functionality that is supposed to be available via CKConsole?
Prior to making the switch to using CloudKit, I've previously used MySQL on a long list of non-iPhone applicaitons - and having access to a command-line interface to the SQL database has always been a very valuable part of my development process. Can anyone suggest ways to re-introduce that CLI type of rapid prototyping into a CloudKit project? Is there a CLI that speaks directly to CloudKit databases (both public and private)?
Many thanks...
in iOS 16 beta 4, the following code ignores the UITextView.appearance().backgroundColor = .clear
struct ContentView: View {
@State var text = "Type something here."
var body: some View {
ZStack {
Color.blue.ignoresSafeArea()
TextEditor(text: $text)
.frame(height: 100)
.padding([.leading, .trailing], 40)
}
.onAppear {
UITextView.appearance().backgroundColor = .clear
}
}
}
Earlier, I had assumed it was Xcode 14 beta 4 - but further investigation shows that it's the new iOS beta.
I would obviously prefer that TextEditor correctly handle it's own .background() method, but in the meantime, any ideas for a workaround?
I have 2 apps in the App Store, and each uses the private database in its own CloudKit container. (ie, App1 uses “iCloud.com.company.App1” and App2 uses “iCloud.com.company.App2”)
I want to add a feature to App2 which will require App2 to read/write to the App1 database. To be clear, we’re talking about 2 apps, 2 private databases, but all access occurs under the same user’s AppleID.
In App2, I’ve tried to create 2 NSPersistentCloudKitContainers - one for each App’s database as follows:
@main
struct App2: App {
@StateObject var app1DB = PersistenceApp1.shared
@StateObject var app2DB = PersistenceApp2.shared
@SceneBuilder var body: some Scene {
WindowGroup {
NavigationView {
ContentView()
.environmentObject(app1DB)
.environmentObject(app2DB)
}
}
}
}
…where each Persistence object is defined like this…
class PersistenceApp1: ObservableObject {
static let shared = PersistenceApp1()
let container: NSPersistentCloudKitContainer
init(inMemory: Bool = false) {
container = NSPersistentCloudKitContainer(name: “App1”)
// expecting to use CloudKit container id: “iCloud.com.company.App1”
…
}
…
}
All read & write operations called from App2 using app1DB (unexpectedly) reads & writes the Entity (which was defined in the App1.xcdatamodeld) to show up in “iCloud.com.company.App2”.
So I end up with the Entity duplicated inside “iCloud.com.company.App1” as well as “iCloud.com.company.App2”. None of App2’s reads nor writes actually use “iCloud.com.company.App1” - they all just use the duplicate App1 entity that shows up inside of “iCloud.com.company.App2”.
Looking in CoreData.NSPersistentCloudKitContainer, I see the following comment:
NSPersistentCloudKitContainer managed one or more persistent stores that are backed by a CloudKit private database.
By default, NSPersistentContainer contains a single store description which, if not customized otherwise, is assigned to the first CloudKit container identifier in an application's entitlements.
Instances of NSPersistentCloudKitContainerOptions can be used to customize this behavior or create additional instances of NSPersistentStoreDescription backed by different containers.
Which suggests why I’m seeing this. However, when I look for samples using NSPersistentCloudKitContainerOptions, all I find is references to using the .shared database as promoted via WWDC21-10015 - which focuses on sharing CloudKit data between different users - which is not my use case.
Question 1: does anyone have any ideas on how to configure the NSPersistentCloudKitContainerOptions to accommodate my use case?
Question 2: does anyone want a micro-consulting gig to help me get this working?
I’m getting this very weird error (send this bug to NSUKVS) when trying to get data from my app into both a lock-screen widget and an Apple Watch app.
Most documentation and online tutorials suggest using App Groups and UserDefaults(suiteName:). I have implemented this and can write to and read from my iOS app to UserDefaults(suiteName:) - no problem.
However, despite the fact that the UserDefaults(suiteName:) is found on both the lock-screen widget and the Apple Watch app - there is never any data found within.
One month ago, Eskimo posted (https://developer.apple.com/forums/thread/710966) that the UserDefaults won’t work in modern devices because the WatchOS app won’t run in an extension on the phone, so we need to use another device-to-device mechanism.
OK, so hoping that one solution will work for both targets, I built a tiny app that intends to implement NSUbiquitousKeyValueStore. (Please note that I have added the iCloud Key-value storage entitlement to the app target.)
Import SwiftUI
struct ContentView: View {
var uks = NSUbiquitousKeyValueStore()
var body: some View {
Text(readData()).onAppear { writeData() }
}
func writeData() {
uks.set("Hello", forKey:"name")
uks.synchronize()
}
func readData() -> String {
return uks.string(forKey:"name") ?? "n/a"
}
}
Unfortunately, I’m getting this:
2022-09-18 17:40:32.538800-0500 Widget[5717:1877533] [Connection] Error synchronizing with cloud for store <(DevID.BundleID.AppName)>: Error Domain=SyncedDefaults Code=101010 "Tried to access unknown store DevID.BundleID.AppName" UserInfo={NSLocalizedDescription=Tried to access unknown store DevID.BundleID.AppName}
2022-09-18 17:57:58.655802-0500 Widget[5727:1883819] [Connection] BUG IN KVS: Tried to access store that is unknown to the system (DevID.BundleID.AppName). Please send this bug to NSUbiquitousKeyValueStore.
Which begs the question:
just how, exactly, does one “send a bug to NSUbiquitousKeyValueStore”??? 🤣
Is this possibly a problem with my AppleID? I ask because I’m getting really weird different results from my app which is currently in the App Store - depending upon if I’ve downloaded my app from Xcode or if I’ve downloaded it from the AppStore. Just wondering if my AppleID has somehow gotten into a corrupted state because of my Promo code (StoreKit) testing…
Any and all ideas / suggestions welcomed…
In the following app, all Buttons open the expected app except the 1st one for “MyApp”. MyApp is installed on the iPhone, but I don’t know what I need to do in order for it to behave similarly to Apple’s Maps & Music, and Uber…
struct ContentView: View {
@Environment(\.openURL) var openURL
var body: some View {
Button("Launch MyApp") { openURL(URL(string:"MyApp://")!) }
Button("Launch Maps") { openURL(URL(string:"Maps://")!) }
Button("Launch Music") { openURL(URL(string:"Music://")!) }
Button("Launch Uber") { openURL(URL(string:"Uber://")!) }
}
}
I’ve got a WatchOS app in the App Store, but since WatchOS 9.1 it’s no longer updating workoutManager.heartRate nor is it saving workout data to Apple’s Health store. Curiously, workoutManager.builder?.elapsedTime, is still correct.
No errors are thrown while executing these lines of code:
session = try HKWorkoutSession(healthStore: healthStore, configuration: configuration)
builder = session?.associatedWorkoutBuilder()
… and shortly after this completion block executes,
session?.startActivity(with: startDate)
builder?.beginCollection(withStart: startDate) { (success, error) in
print("WorkoutMgr.startWorkout() - The workout has started.")
}
… I get the following error messages in my log:
2022-09-28 18:15:01.380071-0500 AppName WatchKit Extension[1240:609337] [workouts] HKLiveWorkoutBuilder_6311 [B194]: (#w0) Failed to update target construction state: Error Domain=com.apple.healthkit Code=3 "Unable to transition to the desired state from the Error(6) state (event 1). Allowed transitions from the current state are: {
}" UserInfo={HKErrorParameter=@"", NSLocalizedDescription=Unable to transition to the desired state from the Error(6) state (event 1). Allowed transitions from the current state are: {
}, HKErrorClass=HKStateMachine, HKErrorSelector=_handleEvent:date:error:completion:}
No developer.apple.com nor StackOverflow.com searches have resulted in any relevant discussions.
Any help will be GREATLY appreciated!
I'm attempting to use Xcode & Instruments to Time Profile my app - but there's something in my environment which is preventing Instruments from linking back to source code. It's this way with all of my apps, and even with a recent tutorial from Kodeco (RayWenderlich.com) - so I'm suspecting my environment.
In Xcode, I select Product -> Profile, which launches Instruments. I select Time Profiler. I click the record button, use the app such that the area of interest is executed, hit stop.
In the Profile section of Instruments, I can see the stack traces, and many of them have function names which are clearly from my app.
When I double-click on them, I expect them to show the source code from Xcode (as detailed in apple docs and the Kodeco tutorial).
However, instead I get this screen which says "Error: Can't find source code for selected symbol"
Most of the question / answers I've seen come from many years ago, which suggests that my problem isn't common - which has me wondering what I've got lurking in my environment that's preventing this from working.
I'm using an M1 Mac w/ Ventura 13.1 Beta (22C5044e) and Xcode Version 14.1 (14B47b).
Any thoughts will be greatly appreciated...
Launch Feedback Assistant, tap new feedback, select macOS - app crashes.
This is true on all 3 platforms that I've tried:
macOS Ventura beta 13.1 (22C5050e)
iOS 16.2 (a) (20C5049e)
iPadOS 16.2 (a) (20C5049e)
I've implemented 2 different AppIntents, each includes their own AppShortcutsProvider with phrases unique to each AppIntent. Individually, they work great. But, when I try to include both in my app, only the last one defined works.
In my ContentView.onAppear(), I've tried calling:
ShortcutsOne.updateAppShortcutParameters()
ShortcutsTwo.updateAppShortcutParameters()
and only those defined in ShortcutsTwo are recognized by Siri.
I've also tried including ShortcutsTwo's AppShortcut(intent:, phrases) into ShortcutOne's AppShortcutsProvider (since it's static var appShortcuts: is defined as an array, ie, [Shortcuts] - but that doesn't work either.
Overall, I've found the system to be rather temperamental. ie, I have had to power off my iPhone & reboot my Mac to get changes recognized.
Any thoughts on how to get 2 or more AppIntents to work in one app?
One of my intents responds to an optional parameter. The parameter is defined as an enum with 4 values (case today, week, month, year). I have 2 AppShortcut phrases defined, one that does not specify the parameter and another which does.
AppShortcut(intent: TopCardsIntent(),
phrases: [
"show \(.applicationName) top cards",
"show \(.applicationName) top cards for \(\.$timeframe)",
],
systemImageName: "atom"
)
The 1st phrase (with no $timeframe) ALWAYS is interpreted by Siri as a Safari lookup.
The 2nd phrase ALWAYS works, but only when I don't specify timeframes '.today' or '.year'. When I do specify '.today' or '.year' - I again always get a Safari lookup.
I've tried all sorts of goofy debugging. Thinking maybe it's because '.today' is 1st and '.year' is the last enum value defined, I added a .decade value. So, the '.decade' works perfect, but '.year' still doesn't. #RandomAF
There are lots of AppShortcut phrases which I'm trying to use that always result in Safari lookups. It almost feels as if Safari has it's own set of AppShortcut phrases, and these are evaluated before mine.
Any ideas?
I've been running OpenJDK & Apache Tomcat on my M1 MBAir - but with Ventura 13.3 I can't any longer...
% java --version
A fatal error has been detected by the Java Runtime Environment:
SIGBUS (0xa) at pc=0x00000001038e6f38, pid=1446, tid=8707
JRE version: (19.0.2) (build )
Java VM: OpenJDK 64-Bit Server VM (19.0.2, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
Problematic frame:
V [libjvm.dylib+0x3baf38] CodeHeap::allocate(unsigned long)+0x1c0
No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
I've tried brew uninstall openjdk, reboots, brew install java, reboots, etc... nothing.
Any thoughts?
Can I transmit a crash log off a user’s device if my app crashes?
The only docs I’ve seen around this so far refer to 2 use cases: a) the device is local and can be connected to Xcode, and b) the end user can access my app’s crash log via Settings -> Privacy -> Analytics -> Analytics Data and then they can share that with me (via email or AirDrop).
However, in AppStoreConnect, we are asked to identify any type of data that is sent to us by the app: ie, where “Collect - refers to transmitting data off the device”
If I navigate as follows: AppStoreConnect -> App Privacy -> Data Types (edit) -> Yes / Next -> Data Collection -> Diagnostics - then one of the options is -> Crash Data (such as crash logs)
I cannot imagine that either of the aforementioned use cases correspond to this Data Collection / Diagnostic data - and so this begs the question: to what does this disclosure item refer? Ie, how can I automatically transmit a crash log so that I don’t have to inconvenience my user after they experience the inconvenience of an app crash?
According to AppStoreConnect, one of my apps is benchmarking above the 75% percentile for crashes - at 1.89%.
Using Xcode’s Organizer window, I’m able to see that 98% of them are identified as:
SwiftUI: EnvironmentObject.error() + 236
Cntl-Click / Show in Finder / Cntl-Click / Show Package Contents / Logs reveals the following:
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [5454]
…and in some of the crash logs, I find this:
Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
What is the graceful way to handle a “resource shortage” when the crash logs show that the error occurs immediately upon app launch - ie, while still declaring .environmentObject()s upon the main ContentView()?
Any help?