Saturday, 25 June 2022

How to compile C/C++ native code in Android Studio 4

I was trying to add C/C++ native code found in a project found in github (here is the link).

  1. I first moved jni folder into src/main folder

  2. I added below lines in my Gradle under android

     externalNativeBuild {
         ndkBuild {
             path 'src/main/jni/Android.mk'
         }
     } 
    
  3. When I tried to sync with Gradle I get below errors:

make: No rule to make target C:/Users/PATH_TO_PROJECT/app/libjitsi/src/main/jni/opus/celt/bands.c

, needed by 'C:/Users/PATH_TO_PROJECT/app/libjitsi/build/intermediates/ndkBuild/debug/obj/local/x86/objs-debug/jnopus/celt/bands.o'.

Stop. executing external native build for ndkBuild C:\Users\PATH_TO_PROJECT\app\libjitsi\src\main\jni\Android.mk CONFIGURE SUCCESSFUL in 8s

Can anyone help me conpile those files with clear steps on How He proceeded ?



from How to compile C/C++ native code in Android Studio 4

No comments:

Post a Comment