Hi, I am encountering an issue with my android apk not reading contents from my XML file. The entire project worked fine on the editor and there is no packaging error. Managed to Logcat the problem and zeroed down the error. Here is the parsing part of the code.
std::string MyString(TCHAR_TO_UTF8(*(FPaths::GameDir() + "Content/XMLFiles/TestRead.xml")));
std::ifstream file(MyString.c_str());
std::stringstream buffer;
buffer << file.rdbuf();
file.close();
std::string content(buffer.str());
UE_LOG(YourLog, Warning, TEXT("contents of xml: %s"), *FString(content.c_str())); //<- This prints out the entire XML content fine on editor
doc.parse<0>(&content[0]);
It seems like the Android device is not reading the XML file. I have check the obb and the XML file is stored in “Content/XMLFiles/TestRead.xml” of the game directory. So the XML file is indeed packaged within.
The Editor printed the content
But the packaged file failed to print the content.
I am relatively new to mobile development and wish someone could shed some light on this matter. Much help is appreciated.