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

Error writing mapping file: No such file or directory #185

Closed
222xiaohuan opened this issue Oct 25, 2016 · 28 comments
Closed

Error writing mapping file: No such file or directory #185

222xiaohuan opened this issue Oct 25, 2016 · 28 comments

Comments

@222xiaohuan
Copy link

Hi there,

I used the tool according to the guide, everything went fine with the installing process. but when I use redex command to compress the apk, I encountered this error: " Error writing mapping file: No such file or directory."
here are my system info and error screenshot.

macosinfo

error2

Can anybody help?

Thanks a lot!

@samyakjain
Copy link

following. Getting same error

@samyakjain
Copy link

@222xiaohuan did you find any solution to this?

@222xiaohuan
Copy link
Author

@samyakjain No, I tried to google the error, but didn't find any clue. :(

@eagertofly
Copy link

the same with me.

@Szmiglo
Copy link

Szmiglo commented Oct 26, 2016

+1 :(

@222xiaohuan
Copy link
Author

Can anybody help? any progress @samyakjain @eagertofly @Szmiglo ?

@eagertofly
Copy link

I guess this is jus one warning and you can still gent the output apk file. @222xiaohuan

@LeerGo
Copy link

LeerGo commented Oct 27, 2016

The same with me, but I can still get a new apk file.
but I fails to install with Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES], look it at readme.md
@eagertofly @222xiaohuan

@eagertofly
Copy link

you need to sign the apk with your keystore @xoder-me

@LeerGo
Copy link

LeerGo commented Oct 27, 2016

@eagertofly yes, i have readed the offical document... i just try it. but thx!

@samyakjain
Copy link

Yes. It is still generating output file so just ignoring this as a warning
and going ahead.

On Thu, Oct 27, 2016 at 7:34 AM, Jason Wang notifications@github.com
wrote:

I guess this is jus one warning and you can still gent the output apk
file. @222xiaohuan https://github.com/222xiaohuan


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#185 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB3ZIW5SuAErJjhU-ufHEvKu_F6wrxp7ks5q4AbIgaJpZM4KfgQ3
.

@222xiaohuan
Copy link
Author

Yes, I can get the package, but before doing the compress, the package size is 18.6M, after doing that, the size is 18.3, so I am not sure if the compress really works. and by the way how the package size changed of yours? @eagertofly @samyakjain @xoder-me

@samyakjain
Copy link

Not much of significant change in package size. That's why i am also in
doubt if redex is properly working or not. Difference of only .1 Mb (from
9.7 to 9.6)

On Fri, Oct 28, 2016 at 1:29 PM, Emily notifications@github.com wrote:

Yes, I can get the package, but before doing the compress, the package
size is 18.6M, after doing that, the size is 18.3, so I am not sure if the
compress really works. and by the way how the package size changed of
yours? @eagertofly https://github.com/eagertofly @samyakjain
https://github.com/samyakjain @xoder-me https://github.com/xoder-me


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#185 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB3ZIdJ7fTbpDiM07aBbPi016vM6Rxulks5q4atkgaJpZM4KfgQ3
.

@bertmaher
Copy link
Contributor

Redex usually doesn't decrease the APK size much; it'll usually make the dexes (bytecode) noticeably smaller, but that compresses well anyways so it doesn't make a big difference in APK size. You can check the dex size using aapt.

On Oct 28, 2016, at 2:42 AM, Samyak <notifications@github.commailto:notifications@github.com> wrote:

Not much of significant change in package size. That's why i am also in
doubt if redex is properly working or not. Difference of only .1 Mb (from
9.7 to 9.6)

On Fri, Oct 28, 2016 at 1:29 PM, Emily <notifications@github.commailto:notifications@github.com> wrote:

Yes, I can get the package, but before doing the compress, the package
size is 18.6M, after doing that, the size is 18.3, so I am not sure if the
compress really works. and by the way how the package size changed of
yours? @eagertofly https://github.com/eagertofly @samyakjain
https://github.com/samyakjain @xoder-me https://github.com/xoder-me

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#185 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AB3ZIdJ7fTbpDiM07aBbPi016vM6Rxulks5q4atkgaJpZM4KfgQ3
.

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/185#issuecomment-256879405, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEPG3F3j-DOY7V7sAvnbJhtRHGrbCZX-ks5q4cNZgaJpZM4KfgQ3.

@asamaru7
Copy link

{
    "redex": {
        "passes": [
            "ReBindRefsPass",
            "BridgePass",
            "SynthPass",
            "FinalInlinePass",
            "DelSuperPass",
            "SingleImplPass",
            "SimpleInlinePass",
            "StaticReloPass",
            "RemoveEmptyClassesPass",
            "ShortenSrcStringsPass"
        ]
    },
    "ShortenSrcStringsPass": {
        "filename_mappings": "filename_mappings.txt"
    }
}

write redex.conf file.

and

redex ~~ -c redex.conf

filename_mappings default value : /tmp/filename_mappings.txt

/tmp/filename_mappings.txt permission denied

@mJackSparrow
Copy link

I have the same problem.:(

@yiwowang
Copy link

I have the same problem.:(

And the command line not working:
ANDROID_SDK=/Users/yiwowang/Library/Android/sdk redex app-debug.apk -o output12345.apk -c config/default.config

@asamaru7
Copy link

@yiwowang
Did you create a "config / default.config" file?

@vipinemvigo
Copy link

I have appended the code
"
"ShortenSrcStringsPass": {
"filename_mappings": "filename_mappings.txt"
}
"
in the 'default.config' file, then tried again with a signed apk, the output apk is generated successfully with the same error message on the terminal "Error writing mapping file: No such file or directory ", but I can't install the apk file.Only change in the apk size is .1 Mb

@asamaru7
Copy link

I write redex.conf.

{
    "redex": {
        "passes": [
            "ReBindRefsPass",
            "BridgePass",
            "SynthPass",
            "FinalInlinePass",
            "DelSuperPass",
            "SingleImplPass",
            "SimpleInlinePass",
            "StaticReloPass",
            "RemoveEmptyClassesPass",
            "ShortenSrcStringsPass"
        ]
    },
    "ShortenSrcStringsPass": {
        "filename_mappings": "filename_mappings.txt"
    }
}

and run redex

$ redex ~~~ -c redex.conf

@vipinemvigo
Copy link

In 'redex ~~~ -c redex.conf' ' ~~~' means path of the config file ?

@asamaru7
Copy link

no. ~~~ is other arguments.

example

$ redex xx.apk -o r.apk -sign --keystore ~~ --proguard-map ~~ --proguard-config ~~  -c /path/redex.conf

@vipinemvigo
Copy link

vipinemvigo commented Dec 28, 2016

ok, thanks
I tried it(without proguard) but the same result again, I have attached a screenshot of the terminal.

untitled

@asamaru7
Copy link

Did you put the following in default.config?

{
    "redex": {
        "passes": [
            "ReBindRefsPass",
            "BridgePass",
            "SynthPass",
            "FinalInlinePass",
            "DelSuperPass",
            "SingleImplPass",
            "SimpleInlinePass",
            "StaticReloPass",
            "RemoveEmptyClassesPass",
            "ShortenSrcStringsPass"
        ]
    },
    "ShortenSrcStringsPass": {
        "filename_mappings": "filename_mappings.txt"
    }
}

And did you reinstall redex to the latest version?

opt/shorten-srcstrings/Shorten.cpp

...
  // generate mapping
  FILE* fd = fopen(map_path, "w");
  if (fd == nullptr) {
    perror("Error writing mapping file");
    return;
  }
...

If the error persists Try removing ShortenSrcStringsPass as it seems to be related to "Shorten".

{
    "redex": {
        "passes": [
            "ReBindRefsPass",
            "BridgePass",
            "SynthPass",
            "FinalInlinePass",
            "DelSuperPass",
            "SingleImplPass",
            "SimpleInlinePass",
            "StaticReloPass",
            "RemoveEmptyClassesPass"
        ]
    }
}

If not, I do not know. sorry.

@vipinemvigo
Copy link

Great, Thanks @asamaru7 for the solution, The third method is work for me, Now there is no error related to the mapping file.Apk is generated without any error message, but unable to install the apk file .

@samyakjain
Copy link

Updated to latest, still getting the same warning. But I have also noticed that my after redux my apk's download size reduced by .9mb . So i am assuming redux is working fine.

@bertmaher
Copy link
Contributor

bertmaher commented Jan 28, 2017 via email

@justinjhendrick
Copy link
Contributor

It sounds like this was fixed back in January. Closing. Please re-open or create a new issue if you see this error again.

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