Building android-ndk?

I want to create a standalone speech recognition application for android. For this, I tried to create an Android NDK. But when I give the ndk-build command, I get the following error. I have no idea what this means, as I am very new to Linux. Someone please help me.

Android NDK: Could not find application project directory ! Android NDK: Please define the NDK_PROJECT_PATH variable to point to it. /home/cenuser/android/android-ndk-r7b/build/core/build-local.mk:130: *** Android NDK: Aborting . Stop. 

and when i changed location i got this

 /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:760:26: error: pocketsphinx.h: No such file or directory /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Hypothesis': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:780: warning: initialization makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:782: warning: assignment makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:784: warning: assignment makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_0': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: 'FALSE' undeclared (first use in this function) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: (Each undeclared identifier is reported only once /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: for each function it appears in.) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_1': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:799: error: 'FALSE' undeclared (first use in this function) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Config_getString': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:830: warning: return makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_0': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:839: error: 'FALSE' undeclared (first use in this function) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_1': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:843: warning: initialization makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getConfig': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:847: warning: return makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getUttid': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:856: warning: return makes pointer from integer without a cast /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getHyp': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: 'int32' undeclared (first use in this function) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: expected ';' before 'best_score' /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:870: error: 'best_score' undeclared (first use in this function) /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10': /home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:1441: warning: assignment discards qualifiers from pointer target type make: *** [/home/cenuser/android/sphinx/PocketSphinxDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1 
+6
source share
5 answers
  • Go to ndk root folder from terminal
  • Enter a command with your project path

     ndk-build -C your_project_path 

This will solve the problem. If you need more information about the "ndk-build" command, just enter the command

  ndk-build --help 
+16
source

This usually happens when you call ndk-build from the wrong directive. You must be in the folder that contains the jni subdirectory.

Or, as an option, report an error message about this - specify NDK_PROJECT_PATH to fix the folder.

+9
source

you need to declare the path to the location during the execution of the ndk-build command

1. cd
2. ndk-build NDK_PROJECT_PATH =

+3
source
  • Go to / build / core
  • Change the path of NDK_PROJECT_PATH to the project project
  • Open terminal
  • Go to project folder
  • Run NDK_BUILD
+1
source

This can be solved as follows: I encountered the same problem. I was working on a text recognition application.

 1- You should go the directory of your folder (which is inside the AndroidStudioProjects - "YOUR PROJECT", 2- There should be a jni (Java Native interface) folder. Search for this folder. whenever, this is found. 3- cd in cmd to that folder (The Parent folder of jni). 4- run **ndk-build** 
0
source

Source: https://habr.com/ru/post/912291/


All Articles