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?
Asked
Active
Viewed 8,133 times
3 Answers
17
In your Android.mk you could override cmd-strip
to do what you want, e.g. nothing:
# Don't strip debug builds
ifeq ($(APP_OPTIM),debug)
cmd-strip :=
endif

Michael
- 57,169
- 9
- 80
- 125
-
5I would instead check the value of NDK_DEBUG, eg: `ifeq ($(NDK_DEBUG),1)` – gmetal Jun 02 '16 at 09:08
-
Thanks so much! IMHO, there is no reason to strip the debug build. I don't understand the motivation behind this. – kakyo Jul 17 '17 at 14:05
-
Possible reasoning behind this is that devices can be low on memory and apk can be huge (in my case it is apk with C++ tests). BTW, putting this in Application.mk doesn't work, Android.mk only. – Andrey Starodubtsev Jan 18 '18 at 14:26
-
Finally after many answers in SO, this worked. Thank you. – LincyTonita Dec 02 '20 at 08:18
0
According to https://github.com/android/ndk/wiki/Changelog-r18-beta2
- Use
APP_STRIP_MODE
inApplication.mk
of your NDK application
ifeq ($(NDK_DEBUG),1)
APP_STRIP_MODE := none
endif
- OR
LOCAL_STRIP_MODE
inAndroid.mk
of your NDK module
ifeq ($(NDK_DEBUG),1)
LOCAL_STRIP_MODE := none
endif

Sunbreak
- 391
- 3
- 8