'NOT strip debug symbols ndk-build

Seems like ndk-build strips debug symbols when it copies .so from obj to lib folder. Is there a way to tell ndk-build not to strip the debug symbols?



Solution 1:[1]

Adding this to Application.mk solved it for me:

APP_STRIP_MODE := none

So, taking suggestions from @Michael and @gmetal:

ifeq ($(NDK_DEBUG),1)
  APP_STRIP_MODE := none
endif

Solution 2:[2]

According to https://github.com/android/ndk/wiki/Changelog-r18-beta2

  • Use APP_STRIP_MODE in Application.mk of your NDK application
ifeq ($(NDK_DEBUG),1)
  APP_STRIP_MODE := none
endif
  • OR LOCAL_STRIP_MODE in Android.mk of your NDK module
ifeq ($(NDK_DEBUG),1)
  LOCAL_STRIP_MODE := none
endif

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vesperto
Solution 2 Sunbreak