Android Native Code Development and Learning (1) Environment Configuration

Android Native Code development and learning (1)

This tutorial is for native code study notes. I hope it can help those in need.

My computer system is Ubuntu 22.04. Of course, Windows is also available. There is not much difference.

Environment configuration

First we create a new native C++ project

Insert image description here

Then we download NDK and CMake

Insert image description here

Note that sometimes after we download it, it will still show that there is no NDK, that is, there will be a null pointer error. In this case, we need to manually specify the NDK directory. If this does not happen, please ignore it. Two manual specification methods are introduced below.

NDK specification method one (it seems there is a bug and sometimes it cannot be used)

Directly select the NDK location below, but most of the time it is gray and cannot be modified. I don’t know if this is a bug or just like this, so it is recommended to use the next method directly.

Insert image description here

NDK specification method two

Modify the path directly in local.properties. If there is no ndk.dir, you can add it manually.

Insert image description here

Then we can sync again. If you don’t know what sync is, the picture above

Insert image description here

It’s this cute elephant. Elephant, why is your trunk so long~

Then we click to run

Insert image description here

Note that there may be a problem asking you to download the latest build tool, just follow its prompts to download it.

This is a blog I wrote a long time ago. Now I am reviewing the technology and re-improving the blog. I hope it can help you.

Guess you like

Origin blog.csdn.net/qq_52380836/article/details/132550213