Redex: OSError: [Errno 2] No such file or directory

Created on 12 Aug 2018  路  9Comments  路  Source: facebook/redex

redex hoangnam$ redex /Users/hoangnam/Documents/work/project_android/SurePortalAndroid/app/release/app-release.apk -o /Users/hoangnam/Documents/work/project_android/SurePortalAndroid/app/release/output.apk
Traceback (most recent call last):
File "/tmp/redex.CC0SHD/redex.py", line 741, in
run_redex(args)
File "/tmp/redex.CC0SHD/redex.py", line 725, in run_redex
finalize_redex(state)
File "/tmp/redex.CC0SHD/redex.py", line 677, in finalize_redex
state.args.keyalias, state.args.keypass, state.args.ignore_zipalign, state.args.page_align_libs)
File "/tmp/redex.CC0SHD/redex.py", line 297, in create_output_apk
zipalign(unaligned_apk_path, output_apk_path, ignore_zipalign, page_align)
File "/tmp/redex.CC0SHD/redex.py", line 247, in zipalign
subprocess.check_call(zipalign + args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(popenargs, *kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(popenargs, *kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Help me ! Thanks you !

Most helpful comment

I think this might be a missing zipalign (or zipalign in a different place than expected)

Does this fix the issue? https://github.com/facebook/redex#im-getting-couldnt-find-zipalign-see-readmemd-to-resolve-this

All 9 comments

I think this might be a missing zipalign (or zipalign in a different place than expected)

Does this fix the issue? https://github.com/facebook/redex#im-getting-couldnt-find-zipalign-see-readmemd-to-resolve-this

redex hoangnam$ ANDROID_SDK=/Users/hoangnam/Library/Android/sdk redex /Users/hoangnam/Documents/work/project_android/SurePortalAndroid/app/release/app-release.apk -o /Users/hoangnam/Documents/work/project_android/SurePortalAndroid/app/release/app-release1.apk
Traceback (most recent call last):
File "/tmp/redex.JUzc1p/redex.py", line 741, in
run_redex(args)
File "/tmp/redex.JUzc1p/redex.py", line 725, in run_redex
finalize_redex(state)
File "/tmp/redex.JUzc1p/redex.py", line 717, in finalize_redex
passes_list = state.config_dict['redex']['passes']
KeyError: u'redex'

Hmmm... I think this might be a bug introduced by bbb7012e72fa8903f825e9d8749086b40b8ec573

@Feng23, would you mind taking a look? I think the recent changes to redex.py crash when no config file is given on the command line.

Thank you, I'll fix it.

Is this issue fixed? I am facing the same issue while running redex old.apk -o new.apk

Does this fix the issue? https://github.com/facebook/redex#im-getting-couldnt-find-zipalign-see-readmemd-to-resolve-this

Seems missing zipalign, does the upper link help?

Does this fix the issue? https://github.com/facebook/redex#im-getting-couldnt-find-zipalign-see-readmemd-to-resolve-this

No tried ANDROID_SDK=/path/to/android/sdk redex [... arguments ...] too.
Getting the same error

I wonder if the arguments to zipalign are given correctly. @danzimm ran into this problem recently and he's working on a fix. I'll send it here because I'm not sure it's ready to land yet. but it might help you find the error.

zipalign_patch.txt

@govindssgr can you try again on top of https://github.com/facebook/redex/commit/f0d28d22a5a221d3dad46bb76c0022fbc9261278 ? Hopefully this helps give a better error to understand what鈥檚 going on

Sent with GitHawk

Was this page helpful?
0 / 5 - 0 ratings