问题描述
我正在用本机代码获取sigsegv 11
,我需要避免剥离以了解问题所在.该应用程序使用库(aar),我能够避免使用'cmd-strip'.但是无论如何,在apk剥离的版本中都使用.so
,因此应用程序可能会在transformNative_libsWithStripDebugSymbolForDebug
gradle任务时剥离符号.有什么需要避免的东西吗?
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应用程序的本机代码符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!