*Patch* expansion file is ignored

I’m following Joshua Quick’s instructions from the comments on this article: https://coronalabs.com/blog/2013/04/17/expansion-file-support-for-android/

  1. Create a new directory to contain the patch’s files.

  2. Copy your update images and assets to this patch directory.

  3. Ipen a Terminal window and “cd” (ie: change directory) to that directory.

  4. Run the following command line to zip it.
    >> zip -r -0 …/patch.zip *

  5. Rename the zip file to the following…
    >> patch…obb

I hope this helps.

My first APK which used an expansion file was version 11, so the expansion file was named:

main.11.com.jeremytm.MiltonsTale.obb

Everything was working fine :slight_smile:

After changing a few images, I needed to use a patch file so that users don’t need to download the entire expansion file again.

On next update (Version 12), I did NOT upload the new main obb file. Instead, on Google Play, I selected the previously uploaded version 11 obb file as the main file, and uploaded the new “patch” file created using the instructions above as the patch file option, named:

patch.12.com.jeremytm.MiltonsTale.obb

So the APK summary shows the version 11 main file, and the version 12 patch. This should result in everything being up to date, or so I thought.

After waiting a few hours for the app to update in the Play Store, and downloading the update, the app is still using images (where applicable) from the OLD main obb, rather than images from the patch file. Quite destructively actually, because one of the changed images was a primary sprite sheet, which has caused all images from that sheet to be all over the show.

Can anyone see anything I’m doing wrong? Is there anyone who has successfully used a patch file?.. can you shed any light?

First, I recommend that you double check that both your main and patch expansion files contain the same relative directory structure.  Meaning that if the image you are patching is in the root folder, then it should not be under a subfolder within the patch file.  Just unzip both of your main and patch files to see if their directory structures match.

Note that the relative ResourceDirectory paths that you use to access your files are relative to the root of your expansion/zip file.

Also, you might want to double check that the patch file was actually downloaded to your SD card.  You can view the files on your device via the Android SDK tool “monitor”… or “ddms” if you are using an older Android SDK.  Unfortunately, every device seems to have a different default location for the expansion file directory, so, you might have to do quite a bit of digging or Google search it for your specific device model.

Ok, I checked everything you said for the next patch and it’s working perfectly.

I have no idea what was wrong with the other one, the relative file structure was the same, the files were where they were supposed to be using monitor, (/storage/sdcard0/Android/obb/[package]/… on an S3).

The only thing I can think of is I was playing with the official obb maker tool “jobb”, and may have uploaded the wrong patch made with that tool, rather than the normal zipped one from your method. Although you’d think that still should have worked.

In any case, it’s resolved :slight_smile:

Thanks for your help.

First, I recommend that you double check that both your main and patch expansion files contain the same relative directory structure.  Meaning that if the image you are patching is in the root folder, then it should not be under a subfolder within the patch file.  Just unzip both of your main and patch files to see if their directory structures match.

Note that the relative ResourceDirectory paths that you use to access your files are relative to the root of your expansion/zip file.

Also, you might want to double check that the patch file was actually downloaded to your SD card.  You can view the files on your device via the Android SDK tool “monitor”… or “ddms” if you are using an older Android SDK.  Unfortunately, every device seems to have a different default location for the expansion file directory, so, you might have to do quite a bit of digging or Google search it for your specific device model.

Ok, I checked everything you said for the next patch and it’s working perfectly.

I have no idea what was wrong with the other one, the relative file structure was the same, the files were where they were supposed to be using monitor, (/storage/sdcard0/Android/obb/[package]/… on an S3).

The only thing I can think of is I was playing with the official obb maker tool “jobb”, and may have uploaded the wrong patch made with that tool, rather than the normal zipped one from your method. Although you’d think that still should have worked.

In any case, it’s resolved :slight_smile:

Thanks for your help.