WatchOS App crash after changing display name - xcode

I was building my application and I decided to change the display name. After the change, this error occurred.
2020-06-16 16:16:39.647223-0700 Test App[4270:147334] [default] -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]:3200: Couldn't instantiate class _TtC37Capsule_Controller_WatchKit_Extension17HostingController
2020-06-16 16:16:39.647359-0700 Test App[4270:147334] [default] -[SPRemoteInterface createViewController:className:properties:contextID:info:gestureDescriptions:clientIdentifier:interfaceControllerCreationCompletion:]:3201: Critical failure. Simulating crash: Condition failed:"NO". Couldn't instantiate class _TtC37Capsule_Controller_WatchKit_Extension17HostingController
(lldb)
I changed the display name for the app and the extension. If you could help, that would be appreciated.

Related

Error of creating MSALPublicClientApplication object in iOS unit test XCTestCase

Got this error when run the unit test XCTestCase on iOS platform.
Error Domain=MSALErrorDomain Code=-50000 "(null)" UserInfo={MSALErrorDescriptionKey=The required app scheme "msauth.com.apple.dt.xctest.tool" is not registered in the app's info.plist file. Please add "msauth.com.apple.dt.xctest.tool" into Info.plist under CFBundleURLSchemes without any whitespaces and make sure that redirectURi "msauth.com.apple.dt.xctest.tool://auth" is register in the portal for your app., MSALInternalErrorCodeKey=-42001}
Follow the error description to add "msauth.com.apple.dt.xctest.tool" into Info.plist for both main app and test target, and register "msauth.com.apple.dt.xctest.tool://auth" in the portal for my app, I still get the error.

SwiftUI previews error: Connecting to launched interactive agent

I received the above error when using the SwiftUI previews feature and can't figure out why this happens. The error always looks something like this:
GenericHumanReadableError: unexpected error occurred
messageRepliedWithError("Connecting to launched interactive agent 1894", Optional(Error Domain=com.apple.dt.xcodepreviews.service Code=17 "connectToPreviewHost: Failed to connect to 1894: (null)" UserInfo={NSLocalizedDescription=connectToPreviewHost: Failed to connect to 1894: (null)}))
I managed to figure out a good way to debug this, please see below
If you head into /Users/USERNAME/Library/Logs/DiagnosticReports you will see the latest crash reports. Open the most recent one (should start with your app name), and it should tell you the reason the app crashed. It'll look something like this:
Application Specific Information:
Fatal error: This request requires an authenticated account: file /Users/USERNAME/Work/AppName/Models/CloudKitAlbumManager.swift, line 101
In my case, it was a fatalError i threw in development for debugging. The previews loads your app and thus call your whole stack and will crash if you like me throws fatalErrors for debugging.
I hope this helps

Machine Learning Error when loading mlmodel "No known class for loading model type > MLModelType_pipelineClassifier"

I have created a mlmodel with Playground and imported into my Xcode project though when it runs I'm getting this error.
The error is also flagged here in the code of the mlmodel.
ObjectClassifier[24610:8307770] [coreml] MLModelAsset:
modelWithError: load failed with error Error Domain=com.apple.CoreML
Code=3 "No known class for loading model type
MLModelType_pipelineClassifier" UserInfo={NSLocalizedDescription=No
known class for loading model type MLModelType_pipelineClassifier}
Why would the code that is automatically created when making the mlmodel in the playground be causing this error?
For me the problem is with IOS-11. I faced the same issue, then I tried with IOS12 device and it works fine.

XPC Service NSCocoaError domain

I've written an Application that uses XPC Service to communicate with its helper. The application launches and works as expected within Xcode.
However, the following error appears when I try to run the application outside of Xcode after I Archive it.
HideMyMac[27183:936477] XPCService error: Error
Domain=NSCocoaErrorDomain Code=4097 "connection to service named
io.jabbari.HideMyMac.HideMyMac-XPCService" UserInfo=
{NSDebugDescription=connection to service named
io.jabbari.HideMyMac.HideMyMac-XPCService}
Here is the source of this application on Github. I normally would provide source with my code, however, the xml style plists would clutter the page and take away from the post.
Here what I have attempted:
Step 1: Updated - Main App Target -> Capabilities Tab
Turned on 'App Sandbox'
Turned on 'App Groups'
Added an app group - 'XYZ'
Step 2: Updated - Helper Target -> Capabilities Tab
Turned on 'App Sandbox'
Enabled 'Outgoing Connections (Client)'
Turned on 'App Groups'
Added an app group - 'XYZ'
What am I missing anything?
This is probably not a good question for StackOverflow, because it's a very project-specific configuration issue.
The actual problem you're running into is that the XPCService crashes immediately:
HideMyMac[5999]: XPCService error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named io.jabbari.HideMyMac-XPCService" UserInfo={NSDebugDescription=connection to service named io.jabbari.HideMyMac-XPCService}
ReportCrash[5995]: Saved crash report for HideMyMac-XPCService[6000] version ??? to …
this is because the SMJobKit framework cannot be found by the dynamic loader at the expected place:
Dyld Error Message:
Library not loaded: #rpath/SMJobKit.framework/Versions/A/SMJobKit
Referenced from: /Users/USER/Library/Developer/Xcode/Archives/2016-02-24/HideMyMac 24.02.16, 16.32.xcarchive/Products/Applications/HideMyMac.app/Contents/XPCServices/HideMyMac-XPCService.xpc/Contents/MacOS/HideMyMac-XPCService
Reason: image not found
So, you should check the copy files / embed framework phases in Xcode's build phases tab.

THREAD 1 SIGABRT error

I just started with Xcode programming and I encountered my first problem when I run my app without any extra codes, methods, properties or classes. I started with the template SINGLE VIEW and I changed the .xib to MainWindow and added an object called basically App Delegate. I removed the single view object from the MainWindow.xib and replaced it with a UIWindow.
I receive the following classic THREAD 1 SIGABRT error:
App[4178:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController" nib but the view outlet was not set.'
*** First throw call stack:
(0x14f8022 0xef8cd6 0x14a0a48 0x14a09b9 0x1222dd 0x122779 0x12299b 0x81401 0x81670 0x81836 0x8872a 0x1ff5 0x59386 0x5a274 0x69183 0x69c38 0x5d634 0x13e2ef5 0x14cc195 0x1430ff2 0x142f8da 0x142ed84 0x142ec9b 0x59c65 0x5b626 0x1d2d 0x1c95 0x1)
terminate called throwing an exception(lldb)
I already reviewed existing postings, but I could not get wiser on it.
It seems very confusing, but is actually very simple. The Thread1: SIGABRT glitch means that something is interrupting your connections.
This may be caused by declaring your connection as weak, and declaring it as strong in your code. In order to tell what you declared your connection by clicking on the object that is having the problem, and then going to the connections inspector (the symbol with a circled arrow). This will let you see the connection.
Now try changing your code declaration from strong to weak (or the other way around), then running your program. If this does not work try deleting the code of the entity, and deleting the connection by hovering over it in the connections inspector and clicking the "X" that shows up.
After deleting the connection, and code try reconnecting the entity and the code should reinstall by itself.

Resources