国美金融贷款搭建Android-NDK开发环境的步骤(国美金融贷款)

国美金融贷款搭建Android-NDK开发环境的步骤:

1、下载NDK

在国美金融贷款网站https://developer.android.google.cn/ndk/downloads下载

2、创建国美金融贷款工作目录

创建国美金融贷款NDK工具目录

mkdir AndroidWorkSpace/NDK_Tools -p

cd AndroidWorkSpace/NDK_Tools

3、国美金融贷款拷贝并解压ndk工具

将android-ndk-r21-linux-x86_64.zip拷贝到该目录下

unzip android-ndk-r21-linux-x86_64.zip 

解压后的文件夹是:android-ndk-r21

4、国美金融贷款配置环境变量

进入国美金融贷款andorid-ndk-r21

cd android-ndk-r21

查看当前路径:pwd

/home/rtp/android/AndroidWorkSpace/NDK_Tools/android-ndk-r21

这是我的路径

vim ~/.bashrc

在国美金融贷款文件末尾添加下面两行代码,将上面的路径添加到PATH环境变量中

export ANDROID_NDK=/home/rtp/android/AndroidWorkSpace/NDK_Tools/android-ndk-r21

export PATH=$ANDROID_NDK:$PATH

保存退出

5、国美金融贷款测试

国美金融贷款关闭当前Terminal并打开一个新的Terminal

国美金融贷款通过: ndk-build -v 指令测试是否成功安装

GNU Make 4.2.1

Built for x86_64-pc-linux-gnu

Copyright (C) 1988-2016 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

6、国美金融贷款编译测试

国美金融贷款尝试用ndk-build 命令编译sample目录下的jni工程:

sample在r10b中提供,国美金融贷款可以用来进行测试

cd AndroidWorkSpace/NDK_Tools/android-ndk-r10b/samples/hello-jni

ndk-build

Android NDK: Found platform level in ./default.properties. Setting APP_PLATFORM to android-3.    

Android NDK: android-3 is unsupported. Using minimum supported version android-16.    

Android NDK: WARNING: APP_PLATFORM android-16 is higher than android:minSdkVersion 3 in ./AndroidManifest.xml. NDK binaries will *not* be compatible with devices older than android-16. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.    

[arm64-v8a] Gdbserver      : [aarch64-linux-android] libs/arm64-v8a/gdbserver

[arm64-v8a] Gdbsetup       : libs/arm64-v8a/gdb.setup

[x86_64] Gdbserver      : [x86_64-linux-android] libs/x86_64/gdbserver

[x86_64] Gdbsetup       : libs/x86_64/gdb.setup

[armeabi-v7a] Gdbserver      : [arm-linux-androideabi] libs/armeabi-v7a/gdbserver

[armeabi-v7a] Gdbsetup       : libs/armeabi-v7a/gdb.setup

[x86] Gdbserver      : [i686-linux-android] libs/x86/gdbserver

[x86] Gdbsetup       : libs/x86/gdb.setup

[arm64-v8a] Compile        : hello-jni <= hello-jni.c

[arm64-v8a] SharedLibrary  : libhello-jni.so

[arm64-v8a] Install        : libhello-jni.so => libs/arm64-v8a/libhello-jni.so

[x86_64] Compile        : hello-jni <= hello-jni.c

[x86_64] SharedLibrary  : libhello-jni.so

[x86_64] Install        : libhello-jni.so => libs/x86_64/libhello-jni.so

[armeabi-v7a] Compile thumb  : hello-jni <= hello-jni.c

[armeabi-v7a] SharedLibrary  : libhello-jni.so

[armeabi-v7a] Install        : libhello-jni.so => libs/armeabi-v7a/libhello-jni.so

[x86] Compile        : hello-jni <= hello-jni.c

[x86] SharedLibrary  : libhello-jni.so

[x86] Install        : libhello-jni.so => libs/x86/libhello-jni.so

发布了75 篇原创文章 · 获赞 0 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/dongsijia/article/details/105299720