How to use c lib(.so) from android?

后端 未结 1 1327
走了就别回头了
走了就别回头了 2021-01-17 01:38

Currently i am working on Android NDK and successfully implementing C code in jni and calling c code using jni on android studio 1.5.

But

1条回答
  •  囚心锁ツ
    2021-01-17 02:30

    Read first my answer here to add *.so libraries:

    https://stackoverflow.com/a/33164947/3626214

    And now, read here how to solve java.lang.UnsatisfiedLinkError: dlopen failed: on Android 6.X devices because you'll get an error on this devices when you add *.so libraries:

    build.gradle

    android
            {
    
                //23 or higher
                compileSdkVersion 23
                buildToolsVersion "23.0.3"
    
    
     defaultConfig
                        {
                            ...
                            //important code, write API 22
                            targetSdkVersion 22
                           ...
                        }
    
    ...
    }
    

    0 讨论(0)
提交回复
热议问题