Android Studio source tree/symbols for prebuilt shared library

460 views
Skip to first unread message

Nathaniel Trost

unread,
Jun 6, 2017, 1:02:24 PM6/6/17
to android-ndk
I'm working with a large existing C++/NDK codebase with Java components, and trying to get it set up as an Android Studio project for easy native C++ debugging in Android Studio. I've tried out the new APK import feature in the Android Studio 3 previews. This results in a project setup, after associating debug symbols for the native libraries, with fully populated source for all the native libraries under /cpp. APK import seems great for a one-off session but problematic for iterative work. But I'm running into issues getting similar source trees for prebuilt shared libraries when trying to configure a 'proper' Android Studio project.

The legacy build process was custom CMake/ninja config to compile libBigCode.so. There was then a secondary ndk-build process to build the app's main stub libMain.so, along with another shared library that was created as a dependency (call it libSupport.so). Finally there was a gradle project to build the java side and generate the final APK.

My problem is that while it was very straightforward to import the Java project and use the Import C++ feature to pull in the ndk-build scripts, I don't get a source hierarchy on the externally built libBigCode.so, under cpp/, even though I'm referencing a debug version with symbols. I *do* get this if I use the APK Import, but that import process seems to be invoking whole lot of special sauce.

I tried migrating from ndk-build to CMake to describe and build libMain.so and its libSupport.so dependency. I got that working, but I was strangely worse off. With the original ndk-build version I had a source hierarchy for both libMain.so and libSupport.so under cpp/ in my Android Studio project, whereas the CMake version only has source for the libMain.so and not libSupport.so, and I don't have a clear understanding why.

I feel like there is perhaps specifications for source tree/symbol association I need to be making in the CMake files, but I don't see any relevant documentation of how to accomplish this.

Prashanthi Shivapooja

unread,
Jun 6, 2017, 1:26:51 PM6/6/17
to andro...@googlegroups.com
Hi

You have to recompile complete source ,so that  new .so file is created which executes your code modified according to your requirement...

Thank you.

Regards 
Pooja

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/6f3fdf23-9a74-4ac8-82e8-6529a5ff02ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages