2

I am getting error "xapk file validation faild" after successfully download an obb file.

A progress reach at 99% then give an error "xapk file validation faild".

I debugging a code and then it thrown an exception "Not a zip archived" from

ZipResourceFile zrf = new ZipResourceFile(fileName);

in ZipResocuceFile,

void addPatchFile(String zipFileName) throws IOException {
  int header = read4LE(f);
        if (header == kEOCDSignature) {
            Log.i(LOG_TAG, "Found Zip archive, but it looks empty");
            throw new IOException();
        } else if (header != kLFHSignature) {
            Log.v(LOG_TAG, "Not a Zip archive");
            throw new IOException();
        }
}

enter image description here

Krunal Shah
  • 1,438
  • 1
  • 17
  • 29

2 Answers2

2

Also i have tried with ZipResourceFile but i had the same error. You can try to mount and unmount your obb file with this class: https://gist.github.com/Clockers/11af3c136b5d283f3560

My obb is created using JObb on a folder containing the file, you can find it here: http://developer.android.com/tools/help/jobb.html

Lorenzo Salani
  • 73
  • 1
  • 1
  • 7
  • Hello, Larenzo Salani Thank you for giving you positive response, Please, send me details where can i add ObbManager class reference and if you have sample code how to implement ObbManager in my existing code then please send me I am getting this error from ZipResourceFile class, so can i replace this by mount unmount process. Thank you – Krunal Shah Sep 18 '15 at 10:28
  • Remember that your application must have the same version of the .obb file. – Lorenzo Salani Sep 18 '15 at 13:45
  • thank you for your response, i am implemented you reference link code but how can i use files which are in obb file in my application – Krunal Shah Sep 19 '15 at 05:50
1

I got a solution, create obb file without using of jobb command, using jobb command it create encrypted obb file, there is no need to create encrypted obb file

I am uploading unencrypted obb file to playstore, here, are steps to create unencrypted obb file

  1. copy you resources files into a folder
  2. create zip file of your resource folder (main.[version_code].[package_name].zip)
  3. rename your zip folder with name (main.[version_code].[package_name].obb)

now, obb file is ready to upload on play store

Its help for me

Krunal Shah
  • 1,438
  • 1
  • 17
  • 29