So the error is not related to json. The Firebase_Url that it is looking for turns out to be associated with a real-time database that I do not use. I don’t know why not check this in code.
I created a realtime database and replaced google-services.json just in case.
Now there is no error related to Json.
But UE5 continues to crash with an error after running the Firestore database access function “An exception was thrown at 0x00007FFBB5AEC2CD (UnrealEditor-FBP.dll) in UnrealEditor.exe: 0xC000001D: Illegal Instruction.”
The error occurs in all functions accessing the database, writing, deleting, reading, listening.
For example:
Here is a piece of code that starts to be executed to access the database and request document ()
void UFBPFirestore::FBPGetDocument(const TArray<FString> DocumentPath, const FOnDocumentRetrieved& OnDocumentRetrieved, const FOnFailToRetrieveDocument& OnFailToRetrieveDocument)
{
#if PLATFORM_WINDOWS || PLATFORM_ANDROID || PLATFORM_IOS || PLATFORM_MAC
bool isDocumentPath = UFBPFirestoreUtilities::FBPIsDocumentReference(DocumentPath);
if(!isDocumentPath)
{
OnFailToRetrieveDocument.ExecuteIfBound("Path is not pointing to a document.");
return;
}
const firebase::firestore::Firestore *Firestore = UFBPFirestore::FBPGetFirestore();
if(UFBPFileUtilities::HasGoogleFile)
{
firebase::firestore::DocumentReference FirebaseDocument = UFBPFirestoreUtilities::FBPGetDocumentReference(Firestore, DocumentPath);
FirebaseDocument.Get().OnCompletion(
[FirebaseDocument, OnDocumentRetrieved, OnFailToRetrieveDocument](const firebase::Future<firebase::firestore::DocumentSnapshot>& Result)
{
if(Result.error())
{
OnFailToRetrieveDocument.ExecuteIfBound(FString(Result.error_message()));
}
else
{
FDocumentSnapshot DocumentSnapshot = FDocumentSnapshot();
const FString DocumentId = FString(FirebaseDocument.id().c_str());
DocumentSnapshot.Id = DocumentId;
DocumentSnapshot.Data = UFBPFirestoreUtilities::FBPGenerateDocumentMap(Result.result()->GetData());
OnDocumentRetrieved.ExecuteIfBound(DocumentId, DocumentSnapshot);
}
});
}
#else
GEngine->AddOnScreenDebugMessage(-1, 30.f, FColor::Red, TEXT("[FBP] Firestore is not available for the current OS you are using. See documentation for more info."));
#endif
}
Unless we provide the document path through the standard UE “Make Array” function. then everything ends well and the program does not crash. code stop here
{
OnFailToRetrieveDocument.ExecuteIfBound("Path is not pointing to a document.");
return;
}
If a path is specified, a breakpoint in VS skips the async code and moves on (I’ve marked with comments where)
firebase::firestore::DocumentReference FirebaseDocument = UFBPFirestoreUtilities::FBPGetDocumentReference(Firestore, DocumentPath);
FirebaseDocument.Get().OnCompletion(
#breakpoint skip that
[FirebaseDocument, OnDocumentRetrieved, OnFailToRetrieveDocument](const firebase::Future<firebase::firestore::DocumentSnapshot>& Result)
{
if(Result.error())
{
OnFailToRetrieveDocument.ExecuteIfBound(FString(Result.error_message()));
}
else
{
FDocumentSnapshot DocumentSnapshot = FDocumentSnapshot();
const FString DocumentId = FString(FirebaseDocument.id().c_str());
DocumentSnapshot.Id = DocumentId;
DocumentSnapshot.Data = UFBPFirestoreUtilities::FBPGenerateDocumentMap(Result.result()->GetData());
OnDocumentRetrieved.ExecuteIfBound(DocumentId, DocumentSnapshot);
}
});
In VS in local, we see this
Next, there is a transition to another file and only the line from the code I marked is executed
DEFINE_FUNCTION(UFBPFirestore::execFBPGetDocument) is executed
{
P_GET_TARRAY(FString,Z_Param_DocumentPath);
P_GET_PROPERTY_REF(FDelegateProperty,Z_Param_Out_OnDocumentRetrieved);
P_GET_PROPERTY_REF(FDelegateProperty,Z_Param_Out_OnFailToRetrieveDocument);
P_FINISH;
P_NATIVE_BEGIN;
#Run that line
UFBPFirestore::FBPGetDocument(Z_Param_DocumentPath,FOnDocumentRetrieved(Z_Param_Out_OnDocumentRetrieved),FOnFailToRetrieveDocument(Z_Param_Out_OnFailToRetrieveDocument));
#
P_NATIVE_END;
}
Next, we move for a long time through the ScriptCore.cpp file up and down.
Then an error occurs
An exception was thrown at 0x00007FFBB5AEC2CD (UnrealEditor-FBP.dll) in UnrealEditor.exe: 0xC000001D: Illegal Instruction.
Unhandled exception at 0x00007FFBB5AEC2CD (UnrealEditor-FBP.dll) in UnrealEditor.exe: 0xC000001D: Illegal Instruction.
Error after executing the code from the ScriptCore.cpp file right after the line I marked
if (!bUsePersistentFrame)
{
// Destroy local variables except function parameters.!! see also UObject::CallFunctionByNameWithArguments
// also copy back constructed value parms here so the correct copy is destroyed when the event function returns
#UE5 crashes immediately after executing this line for (FProperty*
for (FProperty* P = Function->DestructorLink; P; P = P->DestructorLinkNext)
{
if (!P->IsInContainer(Function->ParmsSize))
{
P->DestroyValue_InContainer(NewStack.Locals);
}
else if (!(P->PropertyFlags & CPF_OutParm))
{
FMemory::Memcpy(P->ContainerPtrToValuePtr<uint8>(Parms), P->ContainerPtrToValuePtr<uint8>(NewStack.Locals), P->ArrayDim * P->ElementSize);
}
}
}
Next I was asked to use fix the illegal instructions error
sfc /scannow
and check the ssd disk.
but nothing seems to help