A
A
AleksandrFl2020-09-29 13:17:11
android studio
AleksandrFl, 2020-09-29 13:17:11

How to build android project using NDK? there are .mk files and libraries?

How to build android project using NDK? there are .mk files and libraries?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AleksandrFl, 2020-09-29
@AleksandrFl

Create jni folder:
app/scr/main/jni
in it put library files and mk files
in androidmanifest add the following

sourceSets.main {
        jni.srcDirs = [] // ndk-build.cmd needs to be invoke from cmd
        jniLibs.srcDir 'src/main/libs'
    }

see video https://www.youtube.com/watch?v=kFtxo7rr2HQ
install jdk 8 from oracle site
go to File/Over Settings/Default Project Structure studio settings
and specify folder with installed jdk
C:\Program Files (x86)\Java\jdk1.8.0_261
command in terminal to run build:
cd C:\Users\user\AndroidStudioProjects\MyApplication5\app\src\main
C:\Users\user\AppData\Local\Android\Sdk\ndk\21.3.6528147\build\ndk-build.cmd

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question