x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 google 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 google play store.

  5. Start the game and encounter the xapk file validation failed issue at the downloading screen.

alt text

Here are the Android settings and Unreal Frontend settings:

alt text alt text

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 google play store.

  • Use jobb to zip the \<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 google play store?

Product Version: UE 4.12
Tags:
as.jpg (88.5 kB)
ufn.jpg (44.2 kB)
more ▼

asked Aug 30 '16 at 10:42 AM in Packaging & Deployment

avatar image

wingedrobin
33 5 13 17

avatar image wingedrobin Aug 30 '16 at 11:28 AM

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. alt text

avatar image Samantha Sutton ♦♦ STAFF Sep 06 '16 at 08:21 PM

Hey WingedRobin,

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! :)

avatar image wingedrobin Sep 07 '16 at 02:17 AM

Hi Samantha,

Are you adding 2 APK files?

No, one apk only. According to google's document, I just update a new apk file to replace the old one and a patch obb to the google play developer console.

What is your method of installing the project onto your device when testing?

Download from google play store.

How are you going about adding the patch into your project?

Press the update button on google 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 google 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

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?

avatar image Samantha Sutton ♦♦ STAFF Sep 08 '16 at 03:31 PM

WingedRobin,

You stated that you ZIP your patch.

"If you use ZIP files as your expansion files, the APK Expansion Zip Library 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 Google Market Apk Expansion package includes a library called the APK Expansion Zip Library (located in /extras/google/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!

avatar image wingedrobin Sep 09 '16 at 02:47 AM

Hi Samantha,

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 Google 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?

alt text

alt text

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 google 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 google 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 :)

sdk.jpg (22.8 kB)
zip_file.jpg (68.6 kB)
avatar image wingedrobin Sep 09 '16 at 03:33 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered Sep 23 '16 at 05:41 AM

avatar image

wingedrobin
33 5 13 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

WingedRobin,

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!

more ▼

answered Sep 09 '16 at 05:38 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question