How to avoid stripping for native code symbols for android app

心已入冬 提交于 2019-11-30 06:33:37

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"
}

Fortunately you don't actually need to keep the symbols in the app. The NDK ships a tool called ndk-stack (it's in the root of the NDK) that can symbolize a stack trace for you: https://developer.android.com/ndk/guides/ndk-stack.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!