Post

Replies

Boosts

Views

Activity

Device "..." isnt' registered in your developer account
Hi, I'm using Xcode 15.4. (always export as "Ad Hoc" with automatic signing) and just ran into a weird problem when I tried to run my app with the "play" button on a new iOS 18 iPhone: The build fails every time with the following error message in the "Signing & Capabilities" tab: Device "..." isnt' registered in your developer account. I added the iPhone's UDID to my developer account yesterday but I'm still getting the same error today. There's a "Register Device" button below the error message and when I click it, there are two new errors: There is a problem with the request entity: A device with number '...' already exists on this team. Provisioning profile "iOS Team Provisioning Profile: ...." doesn't include the currently selected device "...." (Identifier ...) The "try again" button below the first part doesn't do anything. How do I fix this?
1
0
288
Jun ’25
Temporarily switch from background thread to main thread (and back?)
I've got a function that runs on a background thread and downloads files: func downloadFiles(remoteFolder rf:String, localFolder lf:String, completion: @escaping (_ success:Bool, _ err: String) -> Void) { DispatchQueue.global(qos:.background).async { ... DispatchQueue.main.async { completion(successBool, errorMsg) } } } It's called by my main ViewController: myDownloadClass.downloadFiles(remoteFolder: rf, localFolder: lf, completion: { (success, error) in ... //More stuff here } Is there a way to temporarily switch back to the main thread (and with that also to the VC) in downloadFiles, so I can add the name of the file that's next in the download list to an e.g. UIAlertController but without tripping off everything that should be done after downloading everything actually finished ("More stuff here")? I'm using Xcode 13 with Swift 5 and iOS 13.
2
0
3.1k
Nov ’21
Resize image with autolayout
My app loads an image at runtime and I want to display it inside a table cell. To do that I created a UIView (trailing/leading/top/bottom: 10) inside the cell and added a UIImageView as its child. What constraints do I need for the child, so the image keeps its proper aspect ration, isn't wider than the width of the screen and there's no unused space (apart from the constraints)? I tried to use: Trailing/leading/top/bottom: 0 Align center x/y This works if the image uses the portrait format but with landscape there's unused space above and below the image. I also tried to set the view's height to ">=50" but no success and I can't just set a max. value because my app has to work on both iPhones and iPads.
2
0
1.5k
Oct ’21
"Unexpectedly found nil while unwrapping an Optional value" with UIColor
Xcode 13.0 is driving me crazy at the moment... I've got a couple of color sets (default sRGB with "Any Appearance" & "Dark") that are used in various UIViewControllers. Two of them I also use in a custom button class: class SpecialBorderButton:UIButton { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { if #available(iOS 13.0, *) { super.traitCollectionDidChange(previousTraitCollection) if (traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection)) { layer.borderColor = UIColor(named: "ButtonBorderColor")!.cgColor } } } } What the code does: When the theme is changed while the app is running, usually the border of a button wouldn't change until you reload the ViewController. traitCollectionDidChange is called when the theme changes and this way the border color is set properly too. The issue navigator has been throwing the same error for 3 different UIViewControllers since I installed Xcode 13: Failed to render and update auto layout status for ViewController (.....): The agent crashed The crash report in Library/Logs/DiagnosticReports says: CoreSimulator 776.3 - Device: iPhone SE (1st generation) (...simulator code...) - Runtime: iOS 15.0 (19A339) - DeviceType: iPhone SE (1st generation) myApp/SpecialButton.swift:26: Fatal error: Unexpectedly found nil while unwrapping an Optional value First of all, I don't even use the SE 1G/iOS 15 simulator but always the SE2/iOS13 one, also, I checked one of the buttons that use that class and pressed "Debug" next to "Designables Crashed" in the Attribute Inspector and it blames the same line: layer.borderColor = UIColor(named: "ButtonBorderColor")!.cgColor ... with the same error: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value The reason why I'm writing this question: The color exists! I checked the spelling multiple times and also copied the name but the errors are still there. I deleted derived data, cleaned the build folder and restarted Xcode and the mac multiple times but the error never fully vanish for all 3 ViewControllers. There aren't any wonky connections to that button either (as far as I've seen). I use UIColor(named:....) with different colors in multiple other classes too (but without the custom class) and they're fine there, it's just this class that's affected, for whatever reason. How do I fix this?
1
0
3.2k
Oct ’21
Xcode crashes when I set an aspect ratio in XIB
Whenever I try to set an aspect ration between two elements (e.g. parent UIView with child UIImageView) by pressing ctrl and dragging from one to the other, then picking "Aspect Ratio" in the new popup list, Xcode crashes. Sometimes I can see the new constraint for a second in the inspector before the crash happens and it says: (null) Ratio to: Img View Already sent 2 bug reports, no point sending any more than that. I'm using Xcode 12.5, I know a new version is out but it won't let me install it because apparently there isn't enough space left (there are 18gb!)... This now also bricked my main storyboard and I can't open it with the IB anymore: The document "Main.storyboard" could not be opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error -1.)
3
0
1.1k
Sep ’21
Device "..." isnt' registered in your developer account
Hi, I'm using Xcode 15.4. (always export as "Ad Hoc" with automatic signing) and just ran into a weird problem when I tried to run my app with the "play" button on a new iOS 18 iPhone: The build fails every time with the following error message in the "Signing & Capabilities" tab: Device "..." isnt' registered in your developer account. I added the iPhone's UDID to my developer account yesterday but I'm still getting the same error today. There's a "Register Device" button below the error message and when I click it, there are two new errors: There is a problem with the request entity: A device with number '...' already exists on this team. Provisioning profile "iOS Team Provisioning Profile: ...." doesn't include the currently selected device "...." (Identifier ...) The "try again" button below the first part doesn't do anything. How do I fix this?
Replies
1
Boosts
0
Views
288
Activity
Jun ’25
Temporarily switch from background thread to main thread (and back?)
I've got a function that runs on a background thread and downloads files: func downloadFiles(remoteFolder rf:String, localFolder lf:String, completion: @escaping (_ success:Bool, _ err: String) -> Void) { DispatchQueue.global(qos:.background).async { ... DispatchQueue.main.async { completion(successBool, errorMsg) } } } It's called by my main ViewController: myDownloadClass.downloadFiles(remoteFolder: rf, localFolder: lf, completion: { (success, error) in ... //More stuff here } Is there a way to temporarily switch back to the main thread (and with that also to the VC) in downloadFiles, so I can add the name of the file that's next in the download list to an e.g. UIAlertController but without tripping off everything that should be done after downloading everything actually finished ("More stuff here")? I'm using Xcode 13 with Swift 5 and iOS 13.
Replies
2
Boosts
0
Views
3.1k
Activity
Nov ’21
Resize image with autolayout
My app loads an image at runtime and I want to display it inside a table cell. To do that I created a UIView (trailing/leading/top/bottom: 10) inside the cell and added a UIImageView as its child. What constraints do I need for the child, so the image keeps its proper aspect ration, isn't wider than the width of the screen and there's no unused space (apart from the constraints)? I tried to use: Trailing/leading/top/bottom: 0 Align center x/y This works if the image uses the portrait format but with landscape there's unused space above and below the image. I also tried to set the view's height to ">=50" but no success and I can't just set a max. value because my app has to work on both iPhones and iPads.
Replies
2
Boosts
0
Views
1.5k
Activity
Oct ’21
"Unexpectedly found nil while unwrapping an Optional value" with UIColor
Xcode 13.0 is driving me crazy at the moment... I've got a couple of color sets (default sRGB with "Any Appearance" & "Dark") that are used in various UIViewControllers. Two of them I also use in a custom button class: class SpecialBorderButton:UIButton { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { if #available(iOS 13.0, *) { super.traitCollectionDidChange(previousTraitCollection) if (traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection)) { layer.borderColor = UIColor(named: "ButtonBorderColor")!.cgColor } } } } What the code does: When the theme is changed while the app is running, usually the border of a button wouldn't change until you reload the ViewController. traitCollectionDidChange is called when the theme changes and this way the border color is set properly too. The issue navigator has been throwing the same error for 3 different UIViewControllers since I installed Xcode 13: Failed to render and update auto layout status for ViewController (.....): The agent crashed The crash report in Library/Logs/DiagnosticReports says: CoreSimulator 776.3 - Device: iPhone SE (1st generation) (...simulator code...) - Runtime: iOS 15.0 (19A339) - DeviceType: iPhone SE (1st generation) myApp/SpecialButton.swift:26: Fatal error: Unexpectedly found nil while unwrapping an Optional value First of all, I don't even use the SE 1G/iOS 15 simulator but always the SE2/iOS13 one, also, I checked one of the buttons that use that class and pressed "Debug" next to "Designables Crashed" in the Attribute Inspector and it blames the same line: layer.borderColor = UIColor(named: "ButtonBorderColor")!.cgColor ... with the same error: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value The reason why I'm writing this question: The color exists! I checked the spelling multiple times and also copied the name but the errors are still there. I deleted derived data, cleaned the build folder and restarted Xcode and the mac multiple times but the error never fully vanish for all 3 ViewControllers. There aren't any wonky connections to that button either (as far as I've seen). I use UIColor(named:....) with different colors in multiple other classes too (but without the custom class) and they're fine there, it's just this class that's affected, for whatever reason. How do I fix this?
Replies
1
Boosts
0
Views
3.2k
Activity
Oct ’21
Xcode crashes when I set an aspect ratio in XIB
Whenever I try to set an aspect ration between two elements (e.g. parent UIView with child UIImageView) by pressing ctrl and dragging from one to the other, then picking "Aspect Ratio" in the new popup list, Xcode crashes. Sometimes I can see the new constraint for a second in the inspector before the crash happens and it says: (null) Ratio to: Img View Already sent 2 bug reports, no point sending any more than that. I'm using Xcode 12.5, I know a new version is out but it won't let me install it because apparently there isn't enough space left (there are 18gb!)... This now also bricked my main storyboard and I can't open it with the IB anymore: The document "Main.storyboard" could not be opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error -1.)
Replies
3
Boosts
0
Views
1.1k
Activity
Sep ’21