apk-patch-size-estimator icon indicating copy to clipboard operation
apk-patch-size-estimator copied to clipboard

No "bsdiff" on PATH, please install or fix PATH.

Open sm-tester opened this issue 7 years ago • 7 comments

Hi, where normally doc by using this library, so I downloaded this repository and copied my apk file into this repository folder with name "old.apk", then I executed following command in terminal:

python apk_patch_size_estimator.py --old-file old.apk --new-file new.apk

here is repository folder and terminal output screenshots:

screen shot 2017-03-04 at 2 12 51 pm screen shot 2017-03-04 at 2 09 52 pm

it said "new.apk - file does not exists", then I created "new.apk" empty file and I executed command again, and here you can see created file in repository folder and terminal results:

screen shot 2017-03-04 at 2 15 57 pm screen shot 2017-03-04 at 2 16 51 pm

I don't understand Google developers strategies, why you always created any useful tools and you said about it is in everywhere (android blog post site, ...), but this tools not works normally by your documentation. Please, remove this bad tools from github.

EDIT I installed bsdiff tools, but appears new a error: "Problem creating file patch"

screen shot 2017-03-04 at 3 14 57 pm

sm-tester avatar Mar 04 '17 09:03 sm-tester

Hi @boyfox

I apologize for any trouble the tool may be causing you.

The tool needs two APKs to compare them and calculate the difference between them, an empty file would not work. Could you run it with two APKs instead?

Thank you, Julian.

juliantoledo avatar Mar 05 '17 14:03 juliantoledo

Hi @juliantoledo!

Unfortunately, I didn't know need passing two APKs, I think I will pass my current APK then library will give me compressed APK.

So, Can I pass my current apk such as old and new apk? or can you upload example video lesson about how to using this library?

sm-tester avatar Mar 06 '17 05:03 sm-tester

Hi @boyfox

Oh, I understand, this library serves a different purpose. It calculates the update size a user will get when installing a newer version of an APK.

What you need is normal APK optimization, you can take a look at: https://developer.android.com/topic/performance/reduce-apk-size.html https://medium.com/google-developers/smallerapk-part-1-anatomy-of-an-apk-da83c25e7003#.f261k8v5c

I hope that helps, regards, Julian

juliantoledo avatar Mar 06 '17 08:03 juliantoledo

Hi @juliantoledo! thank you for clearly definition about this library.

sm-tester avatar Mar 06 '17 16:03 sm-tester

Regarding your latest edit and the resulting error: the tool only works with APK files. One of the inputs isn't an APK file, or has been altered improperly and is no longer valid.

APKs are ZIP files. ZIP files contain an "end of central directory" marker with a 32-bit signature near (usually at) the end of the file. The tool searches for this "end of central directory" marker within the ZIP (APK) file. In this case, the error indicates that the "end of central directory" marker was not found - which means one of your input files is not a valid ZIP (and is therefore not a valid APK).

To be clear, this tool estimates the size of a patch between two versions of an Android application, i.e. an "old" APK and a "new" APK. You need two valid APKs as inputs.

andrewhayden avatar Mar 07 '17 17:03 andrewhayden

I am also facing same issue in Mac OS and I have both the old and new different APK files

Meenas-MacBook-Pro:~ meenakrishna$ python apk_patch_size_estimator.py --old-file old.apk --new-file new.apk
Traceback (most recent call last):
  File "apk_patch_size_estimator.py", line 350, in <module>
    main()
  File "apk_patch_size_estimator.py", line 319, in main
    args.old_file, args.new_file, save_patch_path, temp_path)
  File "apk_patch_size_estimator.py", line 119, in calculate_bsdiff
    find_bins_or_die()
  File "apk_patch_size_estimator.py", line 56, in find_bins_or_die
    bsdiff_path = find_binary('bsdiff')
  File "apk_patch_size_estimator.py", line 81, in find_binary
    'No "' + binary_name + '" on PATH, please install or fix PATH.')
Exception: No "bsdiff" on PATH, please install or fix PATH.
Meenas-MacBook-Pro:~ meenakrishna$ 

Please let me know what I am doing wrong? However I have installed 'bsdiff' and tried setting PATH variable also but I think something is still not working, please help me out.

krishnameena avatar Jan 29 '18 12:01 krishnameena

Do you have bsdiff installed?

On 29 January 2018 at 04:40, Krishna Meena [email protected] wrote:

I am also facing same issue in Mac OS and I have both the old and new different APK files

Meenas-MacBook-Pro:~ meenakrishna$ python apk_patch_size_estimator.py --old-file old.apk --new-file new.apk Traceback (most recent call last): File "apk_patch_size_estimator.py", line 350, in main() File "apk_patch_size_estimator.py", line 319, in main args.old_file, args.new_file, save_patch_path, temp_path) File "apk_patch_size_estimator.py", line 119, in calculate_bsdiff find_bins_or_die() File "apk_patch_size_estimator.py", line 56, in find_bins_or_die bsdiff_path = find_binary('bsdiff') File "apk_patch_size_estimator.py", line 81, in find_binary 'No "' + binary_name + '" on PATH, please install or fix PATH.') Exception: No "bsdiff" on PATH, please install or fix PATH. Meenas-MacBook-Pro:~ meenakrishna$

Please let me know what I am doing wrong?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/apk-patch-size-estimator/issues/3#issuecomment-361233366, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1O_GMG01UaQGC7IZ2rRRN8IWcJmGqzks5tPbxMgaJpZM4MTCHn .

-- -- Julián Toledo

juliantoledo avatar Jan 31 '18 00:01 juliantoledo