如何避免剥离Android应用程序的本机代码符号 [英] How to avoid stripping for native code symbols for android app

查看:332
本文介绍了如何避免剥离Android应用程序的本机代码符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用本机代码获取sigsegv 11,我需要避免剥离以了解问题所在.该应用程序使用库(aar),我能够避免使用'cmd-strip'

I'm getting sigsegv 11 in native code and i need to avoid stripping to understand what's wrong. The app uses library (aar) and i was able to avoid stripping for the aar with 'cmd-strip' hack. But in the apk stripped version of .so is used anyway so the app strips the symbols, probably while transformNative_libsWithStripDebugSymbolForDebug gradle task. Any change to avoid it?

PS.在SO上找到了类似的问题,但有点不同(在这里使用aar,在我的情况下没有剥离的符号).

PS. Found similar question on SO but it's a bit different (using aar here with not stripped symbols in my case).

推荐答案

包装选项中有一个未记录的方法'doNotStrip',只需在build.gradle中添加以下几行

There's an undocumented method 'doNotStrip' in packagingOptions, just add following lines in your build.gradle

packagingOptions{
    doNotStrip "*/armeabi/*.so"
    doNotStrip "*/armeabi-v7a/*.so"
    doNotStrip "*/x86/*.so"
}

这篇关于如何避免剥离Android应用程序的本机代码符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆