Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redex-all crashed with exit code 1 #765

Open
guobao90 opened this issue Feb 22, 2023 · 10 comments
Open

redex-all crashed with exit code 1 #765

guobao90 opened this issue Feb 22, 2023 · 10 comments

Comments

@guobao90
Copy link

python3 redex.py -c default.config -o /Users/leo.zhang/Desktop/json/release/mcc_origin_out.apk /Users/leo.zhang/Desktop/json/release/mcc_origin.apk

error message:
[ERROR ] Expecting value: line 9 column 45 (char 212)
[WARNING ] Could not find an SDK jar: Could not find SDK path, searched Env, Buck
Trace settings:
TRACEFILE=
SHOW_TIMESTAMPS=
SHOW_TRACEMODULE=
TRACE_METHOD_FILTER=
TRACE_CLASS_FILE=
TRACE_CLASS_NAME=
error: No ProGuard keep rules provided. Redex optimizations will not preserve semantics without accurate keep rules.
Traceback (most recent call last):
File "/Users/leo.zhang/AndroidProject/redex/redex.py", line 1345, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "/Users/leo.zhang/AndroidProject/redex/pyredex/utils.py", line 62, in with_temp_cleanup
fn()
File "/Users/leo.zhang/AndroidProject/redex/redex.py", line 1345, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "/Users/leo.zhang/AndroidProject/redex/redex.py", line 1324, in run_redex
run_redex_binary(state, exception_formatter, output_line_handler)
File "/Users/leo.zhang/AndroidProject/redex/redex.py", line 397, in run_redex_binary
run()
File "/Users/leo.zhang/AndroidProject/redex/redex.py", line 390, in run
raise RedexRunException(msg, returncode, abort_error, symbolized)
main.RedexRunException: redex-all crashed with exit code 1! You can re-run it under gdb by running /var/folders/hx/78lkd49x14zcvmytj_6z8pkc3mx2f9/T/redex-gdb-crkljhsp.sh or under lldb by running /var/folders/hx/78lkd49x14zcvmytj_6z8pkc3mx2f9/T/redex-lldb-3eh35mq9.sh

please help check this

@NTillmann
Copy link
Contributor

Somehow you seem to have a JSON parser that doesn't like the '#' comments in the default.config file. Can you edit it, and remove '#' and everything that follows in each line, and see if that fixes things for you?

@leo9006
Copy link

leo9006 commented Feb 23, 2023

Somehow you seem to have a JSON parser that doesn't like the '#' comments in the default.config file. Can you edit it, and remove '#' and everything that follows in each line, and see if that fixes things for you?

I remove the '#' in the comment, it doesn't work, it does not have this error

[ERROR ] Expecting value: line 9 column 45 (char 212)

others still have the same error message

@NTillmann
Copy link
Contributor

I remove the '#' in the comment, it doesn't work [...]

Please try removing the entire comment, not just the leading '#'. The content needs to become legal JSON.

@guobao90
Copy link
Author

Yes, I remove all the comment

this is the detail config, but still have the same error message

{ "redex" : { "passes" : [ "ReBindRefsPass", "BridgeSynthInlinePass", "FinalInlinePassV2", "DelSuperPass", "SingleImplPass", "MethodInlinePass", "StaticReloPassV2", "RemoveEmptyClassesPass", "ShortenSrcStringsPass", "RegAllocPass" ] } }

@guobao90
Copy link
Author

guobao90 commented Mar 6, 2023

I remove the '#' in the comment, it doesn't work [...]

Please try removing the entire comment, not just the leading '#'. The content needs to become legal JSON.

Yes, I remove all the comment

this is the detail config, but still have the same error message

{ "redex" : { "passes" : [ "ReBindRefsPass", "BridgeSynthInlinePass", "FinalInlinePassV2", "DelSuperPass", "SingleImplPass", "MethodInlinePass", "StaticReloPassV2", "RemoveEmptyClassesPass", "ShortenSrcStringsPass", "RegAllocPass" ] } }

is there any update?

@Huxn
Copy link

Huxn commented Mar 6, 2023

I remove the '#' in the comment, it doesn't work [...]

Please try removing the entire comment, not just the leading '#'. The content needs to become legal JSON.

Yes, I remove all the comment

this is the detail config, but still have the same error message

{ "redex" : { "passes" : [ "ReBindRefsPass", "BridgeSynthInlinePass", "FinalInlinePassV2", "DelSuperPass", "SingleImplPass", "MethodInlinePass", "StaticReloPassV2", "RemoveEmptyClassesPass", "ShortenSrcStringsPass", "RegAllocPass" ] } }

is there any update?

I have the same problem, based on the master code

@fdh19979
Copy link

fdh19979 commented Mar 6, 2023

I have the same problem

/Users/user/redex/redex.py:24: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
from pipes import quote
Trace settings:
TRACEFILE=
SHOW_TIMESTAMPS=
SHOW_TRACEMODULE=
TRACE_METHOD_FILTER=
TRACE_CLASS_FILE=
TRACE_CLASS_NAME=
error: No ProGuard keep rules provided. Redex optimizations will not preserve semantics without accurate keep rules.
Traceback (most recent call last):
File "/Users/fudonghui/redex/redex.py", line 1345, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "/Users/fudonghui/redex/pyredex/utils.py", line 62, in with_temp_cleanup
fn()
File "/Users/fudonghui/redex/redex.py", line 1345, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
^^^^^^^^^^^^^^^
File "/Users/fudonghui/redex/redex.py", line 1324, in run_redex
run_redex_binary(state, exception_formatter, output_line_handler)
File "/Users/fudonghui/redex/redex.py", line 397, in run_redex_binary
run()
File "/Users/fudonghui/redex/redex.py", line 390, in run
raise RedexRunException(msg, returncode, abort_error, symbolized)
RedexRunException: redex-all crashed with exit code 1! You can re-run it under gdb by running /var/folders/58/0n0pypp5257718fhxvy7frfh0000gn/T/redex-gdb-x2kc4qnp.sh or under lldb by running /var/folders/58/0n0pypp5257718fhxvy7frfh0000gn/T/redex-lldb-ux2zwbin.sh

@NTillmann
Copy link
Contributor

So it seems like you could workaround the first error:

[ERROR ] Expecting value: line 9 column 45 (char 212)

But what remains is the second error:

error: No ProGuard keep rules provided. Redex optimizations will not preserve semantics without accurate keep rules.

You need to provide ProGuard keep rules.

@lybill
Copy link

lybill commented Mar 19, 2023

So it seems like you could workaround the first error:

[ERROR ] Expecting value: line 9 column 45 (char 212)

But what remains is the second error:

error: No ProGuard keep rules provided. Redex optimizations will not preserve semantics without accurate keep rules.

You need to provide ProGuard keep rules.

How to solve this? I am also facing this problem

python redex.py --redex-binary build-cmake/redex-all.exe -o oouutt.apk C:\Users\hp\Desktop\app.apk

[WARNING ] No embedded files, please add manually!
[ERROR ] expected str, bytes or os.PathLike object, not NoneType
Trace settings:
TRACEFILE=
SHOW_TIMESTAMPS=
SHOW_TRACEMODULE=
TRACE_METHOD_FILTER=
TRACE_CLASS_FILE=
TRACE_CLASS_NAME=
error: No ProGuard keep rules provided. Redex optimizations will not preserve semantics without accu
rate keep rules.
Traceback (most recent call last):
File "D:\redex\redex\redex.py", line 1399, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "D:/redex\redex/pyredex/utils.py", line 62, in with_temp_cleanup
fn()
File "D:\redex\redex\redex.py", line 1399, in
with_temp_cleanup(lambda: run_redex(args), args.always_clean_up)
File "D:\redex\redex\redex.py", line 1365, in run_redex
run_redex_binary(state, exception_formatter, output_line_handler)
File "D:\redex\redex\redex.py", line 398, in run_redex_binary
run()
File "D:\redex\redex\redex.py", line 377, in run
raise RuntimeError(default_error_msg)
RuntimeError: redex-all crashed with exit code 1!

@NTillmann
Copy link
Contributor

https://fbredex.com/docs/proguard contains information on how to pass Proguard rules to Redex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants