Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ndk not bundle v8 .a file symbols

I have a project which similar too J2V8 which bundle v8 to android. But after compile J2V8 has all v8 symbols but similar project lose all v8 symbols. You can check the original J2V8.so here by using command

nm -D libj2v8.so | grep "GetIsolate"

you can get something like

003530fc T _ZN2v815SnapshotCreator10GetIsolateEv
003613c4 T _ZN2v86Object10GetIsolateEv
0035f78c T _ZN2v87Context10GetIsolateEv
0038c354 W _ZNK2v88internal10HeapObject10GetIsolateEv
00503a78 T _ZNK2v88internal11MessageImpl10GetIsolateEv
00503b4c T _ZNK2v88internal16EventDetailsImpl10GetIsolateEv

But after compile sample project, the related output is none.

like image 250
Geng Jiawen Avatar asked Sep 22 '18 09:09

Geng Jiawen


People also ask

What are ABI filters?

Stay organized with collections Save and categorize content based on your preferences. Different Android devices use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction set has its own Application Binary Interface (ABI).

How do I know what version of NDK I have?

Go to Tools->SDK Manager (or Files->Settings->Appearance & Behavior->System Settings->Android SDK ). Then select the SDK Tools tab, and check the Show Package Details checkbox. You will see your NDK version.

How do I know if android NDK is installed?

You'll need to point to your NDK in your eclipse by adding the path of ndk-build to Window > preferences > android > NDK. Right click on your project folder. Choose android tools -> add native support (the bottom one) and click finish. Now it will ask for a name for your .


1 Answers

For Android Studio project, either library .aar or application .apk, during the build process, there is a step stripping the debug symbols of dynamic shared libs, i.e. the .so.

If you want to keep all the symbols un-removed, then you can add below configuration into your build.gradle.

android {
    ...
    packagingOptions{
        doNotStrip "*/armeabi/*.so"
        doNotStrip "*/arm64-v8a/*.so"
        doNotStrip "*/armeabi-v7a/*.so"
        doNotStrip "*/x86/*.so"
        doNotStrip "*/x86_64/*.so"
    } 
    ...
}
like image 168
shizhen Avatar answered Sep 20 '22 04:09

shizhen