[XCode error] after target device factory reset

Hello!

I have encountered problem with error message

"Uncaught exception: NSInternalInconsistencyException: Couldn't add the Keychain)"

so this error only happens after when I completely reset the iPhone and set all the initial information (such as Apple ID, face ID and etc).

I have built Unity Project as ".xcworkspace" file and build it with XCode, after building, it launches on iPhone which is connected with Mac(for XCode build).

when I launch the app,

int main()
{
     id ufw = UnityFrameWorkLoad();
     [ufw runUIApplicationMainWithArgc: argc argv: argv];  // breaks here
     return 0;
}

the app stops on this lines of code.

This always happens when I reset the iPhone and it can only be fixed if I logout my APPLE ID and relogin, but never works vice versa.

Anyone can help with this problem? It is bothering me for 2weeks..!!

Thank you.

[XCode error] after target device factory reset
 
 
Q