I had already uploaded an apk and a main obb file of release version to play store. It works fine. Now I’m trying to patch my released game by using patch expansion file. Here are the steps I tried.
Modify to my game content.
Use Unreal Frontend to generate a patch file base on released one.
Upload the new apk and the obb(named main.version.com.company.project-name.obb) as a patch expansion obb file under <project-name>/Binaries/Android folder.
Update the game through play store.
Start the game and encounter the xapk file validation failed issue at the downloading screen.
When you’re patching your game, are you adding 2 APK files?
What is your method of installing the project onto your device when testing?
How are you going about adding the patch into your project?
Is this happening with every single project that you package, when using a patch?
I’m following your steps, and I’ve gotten my project onto the device, but the patch steps you provided aren’t being saved to: \Saved\StagedBuilds\Android_ETC1\ folder which is throwing me off.
No, one apk only. According to 's [document][1], I just update a new apk file to replace the old one and a patch obb to the play developer console.
What is your method of installing the project onto your device when testing?
Download from play store.
How are you going about adding the patch into your project?
Press the update button on play store when the uploaded new apk and patch obb had been published.
Is this happening with every single project that you package, when using a patch?
Sorry, I only try this in a single test project.
the patch steps you provided aren’t being saved to: \Saved\StagedBuilds\Android_ETC1\ folder
I mean if I use unreal frontend to make a patch. There will generate a pak file under \Saved\StagedBuilds\Android_ETC1\ folder. Then I use jobb to zip this pak file as a patch obb, and upload to play store.
English is not my native tongue, so please forgive me if I makes you misunderstanding.
Here is the log when I got the xapk file validation failed message, hope it can give you some information.
[Log file][2]
And I think the xapk file validation failed message in the download screen is showed by DownloaderActivity.java at line 464 (in function onPostExecute). So maybe the reason of this issue is cause by CRC checking process in function doInBackground?
“If you use ZIP files as your expansion files, the [APK Expansion Zip Library][1] that’s included with the Apk Expansion package includes the ability to merge your patch file with the main expansion file.”
Did you follow the APK Expansion Zip Library file?
“The Market Apk Expansion package includes a library called the APK Expansion Zip Library (located in /extras//google_market_apk_expansion/zip_file/). This is an optional library that helps you read your expansion files when they’re saved as ZIP files.”
It goes into further explanation of testing your expansion files, and even updating your application. I believe some steps were missed here, which is why it’s stating the OBB file is missing.
Yes, I did zip my patch(without compression). But that is one of many ways I tried. I did also try upload my patch file without zip too, but still got the same XAPK file validation failed message. So even if I use jobb or zip to encapsulate the patch without compression, I still need to use APK Expansion Zip Library?
I’m sure I already install the Play Apk Expansion library, and I have APK Expansion Zip Library under the path that you mentioned. How can I check if this library is enabled in unreal engine or not?
I found a reference, should I follow the step and copy the library source to my unreal project?
Let me put it another way if that will be more clear. My question is, if I want to use patch obb file to patch my game, what kind of file should I upload to play store? For example, if I use unreal frontend to create a patch file base on a released game. I can get:
A new apk file and A main.VersionNumber.PackageName.ProjectName.obb under the ProjectName\Binaries\Android folder.
A pak(ex: ProjectName-Android_ETC1_P.pak) file under ProjectName\Saved\StagedBuilds\Android_ETC1*ProjectName*\Content\Paks\
And the file in main.VersionNumber.PackageName.ProjectName.obb exactly the same with the 2 (*ProjectName*\Content\Paks*ProjectName*-Android_ETC1_P.pak). So is this pak file that I can upload to play store as a patch obb to patch my game? If yes, should I use jobb to encapsulate the pak file with folder path(*ProjectName*\Content\Paks) or without folder path? Or just upload the main.obb is fine? If no, then what file should I upload?
I spoke with our Android Developer and it looks like you need to have the APK replaced when you’re patching. The version and file length of the OBB is cooked into the downloader source in the APK for the validation. Please look in obbdata.java in the project’s Intermediate/Android/APK/src/[path for your package name]/obbdata.java. If a different OBB is downloaded it will fail the verify.
It is possible to turn off the validation for non-distribution builds with the Disable Verify OBB on Startup checkbox. To allow this for distribution you can change GenerateManfiest() in UeDeployAndroid.cs:
I think I found the reason why patch obb isn’t used. Below is the OBBData.java file after the package process of a project release.
package com.YourCompany.TestPakWin2;
public class OBBData
{
public static class XAPKFile {
public final boolean mIsMain;
public final String mFileVersion;
public final long mFileSize;
XAPKFile(boolean isMain, String fileVersion, long fileSize) {
mIsMain = isMain;
mFileVersion = fileVersion;
mFileSize = fileSize;
}
}
public static final XAPKFile[] xAPKS = {
new XAPKFile(
true, // true signifies a main file
"10034", // the version of the APK that the file was uploaded against
26529245L // the length of the file in bytes
)
};
};
And here is the OBBData.java file after the package process of a project patch.
package com.YourCompany.TestPakWin2;
public class OBBData
{
public static class XAPKFile {
public final boolean mIsMain;
public final String mFileVersion;
public final long mFileSize;
XAPKFile(boolean isMain, String fileVersion, long fileSize) {
mIsMain = isMain;
mFileVersion = fileVersion;
mFileSize = fileSize;
}
}
public static final XAPKFile[] xAPKS = {
new XAPKFile(
true, // true signifies a main file
"10035", // the version of the APK that the file was uploaded against
6622348L // the length of the file in bytes
)
};
};
There is only one XAPKFile object(main obb) in xAPKS array. But it should be two XAPKFile instance to represent main and patch obb file respectively.
Then I search in engine code and found some clue in file \Engine\Source\Programs\UnrealBuildTool\Android\UEDeployAndroid.cs. At line 421 says: For each obb file… but we only have one… for now anyway.. So, it seems UE4 is only support main obb currently.