I've been having a hell of a time moving a code base from an old intel macbook to a newer m1 chip macbook. I've jumped through many hoops and finally got the code to compile after removing all cocoapods and switching to swift manager.
Per screenshots, now that I'm in the iphone simulator and testing out various screens, I'm having random bugs pop up in my AppDelegate file that just don't make any sense and were not an issue on my intel macbook at all. I've tried a 100 architecture setting changes and nothing is helping.
FYI - I'm trying my best to get this all working on Xcode version 15.0.1 as I'd like to code going forward on their latest platform.
I get this below error for either of the errors I have in the screenshots:
warning: Module "/usr/lib/system/libsystem_kernel.dylib" uses triple "arm64-apple-macosx13.6.0", which is not compatible with the target triple "arm64-apple-ios16.0.0-simulator". Enabling per-module Swift scratch context.
Error #1: Thread 1: “*** -[NSConcreteTextStorage attributesAtIndex:longestEffectiveRange:inRange:]: Range or index out of bounds”
Error #2: Thread 1: “[<UICollectionViewCell 0x10b3b6e40> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dayOfMonth.”
class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
var window: UIWindow?
let appId: String = "****"
let region: String = "us"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let mySettings = AppSettings.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region: region).build()
CometChat.init(appId: appId ,appSettings: mySettings,onSuccess: { (isSuccess) in
if (isSuccess) {
print("CometChat Pro SDK intialise successfully.")
}
}) { (error) in
print("CometChat Pro SDK failed intialise with error: \(error.errorDescription)")
}
FirebaseApp.configure()
GMSPlacesClient.provideAPIKey("****")
UNUserNotificationCenter.current().delegate = self
application.registerForRemoteNotifications()
//UIApplication.shared.applicationIconBadgeNumber = 1
Messaging.messaging().delegate = self
let config = CheckoutConfig(
clientID: "****",
environment: .live
)
Checkout.set(config: config)
return true
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Cannot register for notifications: \(error)")
}


To close this out - I found two solutions:
The important takeaway was deselecting debug executable.