What is the correct way to patch with patch obb expansion file?

Hi,

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.

  1. Modify to my game content.
  2. Use Unreal Frontend to generate a patch file base on released one.
  3. 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.
  4. Update the game through play store.
  5. Start the game and encounter the xapk file validation failed issue at the downloading screen.

Here are the Android settings and Unreal Frontend settings:

And I’ve already tried in different ways to generate the patch obb file:

  • Rename the main.version.com.company.project-name.obb to patch.version.com.company.project-name.obb before upload to play store.
  • Use jobb to zip the &lt;project-name>\Saved\StagedBuilds\Android_ETC1\ folder as a patch obb file.
  • Follow this article to disable Store all content in a single file (UnrealPak) option.

But these still got the same xapk file validation failed issue.

Did I do anything wrong? What is the correct way to patch my game with patch expansion file through the play store?

PS 1: If I look into the Android/obb/com.company.project-name/ folder, the main and patch obb are already downloaded.

PS 2: If I close the game and restart it again, it will show message like follow.

Hey ,

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.

Looking forward to hearing back from you, thanks! :slight_smile:

Hi ,

Are you adding 2 APK files?

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?

https://developer.android.com//play/expansion-files.html#Updating
[2]: 105947-xapk_file_validation_failed.txt (3.97 KB)

,

You stated that you ZIP your patch.

“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.

Thank you!

https://developer.android.com//play/expansion-files.html#ZipLib

Hi ,

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?

106284-sdk.jpg

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:

  1. A new apk file and A main.VersionNumber.PackageName.ProjectName.obb under the ProjectName\Binaries\Android folder.
  2. 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?

Thanks :slight_smile:

By the way, I follow the document to add OnlineSubsystemGooglePlay into my Build.cs. I think this is necessary, right?

,

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:

		Text.AppendLine(string.Format("\t\t<meta-data android:name=\"com.epicgames.ue4.GameActivity.bVerifyOBBOnStartUp\" android:value=\"{0}\"/>", (bIsForDistribution && !bDisableVerifyOBBOnStartUp) ? "true" : "false"));

to

		Text.AppendLine(string.Format("\t\t<meta-data android:name=\"com.epicgames.ue4.GameActivity.bVerifyOBBOnStartUp\" android:value=\"{0}\"/>", !bDisableVerifyOBBOnStartUp) ? "true" : "false"));

I hope this helps. Please let us know if you have any further questions, thanks!

Hi,

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.

Please correct me if I am wrong.

Hi,
5 years later it still seem to support only main oob fail.
Do you have any solution for the patching?
Thanks.

1 Like

While iterating with packing I tested using patch as well, but after disabling it, it still generates a patch OBB? Any clues how to change this?

I’m also looking for a solution. Any ideas?