# MyNdkJniDemo **Repository Path**: android100/MyNdkJniDemo ## Basic Information - **Project Name**: MyNdkJniDemo - **Description**: ndk/jni : 使用ndk-build方式 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-14 - **Last Updated**: 2021-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 报错: ``` java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[ DexPathList[[zip file "/data/app/com.example.myndkjnidemo-tQiU7i-8yQdnuC1-yo1Fvg==/base.apk"], nativeLibraryDirectories=[ /data/app/com.example.myndkjnidemo-tQiU7i-8yQdnuC1-yo1Fvg==/lib/arm64, /system/lib64, /system/product/lib64]]] couldn't find "libhello.so" ``` 请配置: ```c //ndkBuild 需要 指定path externalNativeBuild { ndkBuild { path 'src/main/jni/Android.mk' } } ``` # android.useDeprecatedNdk 过期: ```c The option 'android.useDeprecatedNdk' is deprecated. ``` # local.properties:ndk.dir过期: ``` NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. If you delete ndk.dir from local.properties and set android.ndkVersion to [22.1.7171670] then NDK at /Users/tmk/Library/Android/sdk/ndk/22.1.7171670 will be used. https://developer.android.com/r/studio-ui/ndk-dir ``` # Android 构建 so 库的两种方式 : [ndk-build方式 demo](https://gitee.com/android100/MyNdkJniDemo) [cmake方式(推荐) demo](https://gitee.com/android100/MyNativeC)