NDK生成.so文件
发布时间:
- Android studio 打开SDK Manager--》Android SDK--》SDK tools--》勾选NDK 下载
- 打开 meky/.bash_profile添加
js
export NDK_HOME=/Users/meky/Library/Android/sdk/ndk-bundle
export PATH=$PATH:$NDK_HOME/
后为:
js
export PATH=/Users/meky/Library/Android/sdk/platform-tools/:$PATH
export NDK_HOME=/Users/meky/Library/Android/sdk/ndk-bundle
export PATH=$PATH:$NDK_HOME/
保存 更新刚配置的环境变量输入source .bash_profile (如果没有更新成功,尝试重启电脑)
3. 输入ndk-build看是否成功
4. 命令窗口进入 cd /Users/meky/Documents/workspace_AS/MonitorCenter/libWSLive/src/main/jni
5. 执行 ndk-build (工程中配置好 build.gradle )
js
ndk {
abiFilters "armeabi-v7a", "x86", "armeabi"
}
- 生成.so
参考https://blog.csdn.net/cheng2290/article/details/77717164