Menu

Building Pocketsphinx-Android on Windows 10 with AndroidStudio

Help
Jean Chung
2017-07-27
2017-07-27
  • Jean Chung

    Jean Chung - 2017-07-27

    Hi,

    I have problems with creating pocketsphinx-android-5prealpha-debug.aar

    I followed the steps in https://cmusphinx.github.io/wiki/tutorialandroid/#building-pocketsphinx-android, but when gradle build process is running I get the following output:

    CMake Error at CMakeLists.txt:106 (add_library):
    Cannot find source file:
    build/generated-src/cpp/pocketsphinx_wrap.c
    Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
    .hxx .in .txx
    CMake Error: CMake can not determine linker language for target: pocketsphinx_jni

    local.properties paths for ndk.dir and sdk.dir are set correctly.
    I use the build.gradle script which comes with the pocketsphinx-android from the github repository.
    I installed the latest SWIG (3.0.12) and get the same error when manually typing in the swig-command in cmd as following:

    swig -I../sphinxbase/include -I../sphinxbase/swig -java -package edu.cmu.pocketsphinx -outdir build/generated-src/java -o build/generated-src/cpp/sphinxbase_wrap.c ../sphinxbase/swig/sphinxbase.i

    swig -I../sphinxbase/swig -I../pocketsphinx/include -I../pocketsphinx/swig -java -package edu.cmu.pocketsphinx -outdir build/generated-src/java -o build/generated-src/cpp/pocketsphinx_wrap.c ../pocketsphinx/swig/pocketsphinx.i

    I created the output directories manually because the task mkdir didn't work.

    I have not worked with swig or jni before, but I was hoping that AndroidStudio would do the work for me.
    Unfortunately, using the prebuilt Pocketsphinx-Android-Demo library is not an option for me.

    Could anyone give me advise on how to get this building process working?

     
    • Nickolay V. Shmyrev

      Run

      gradle clean && gradle -i build >& build.log

      and share build.log

       
      • Jean Chung

        Jean Chung - 2017-07-27

        Hi Nickolay,

        thank you for you help.
        I installed the newest version of gradle(4.0.2) and running the build in cmd was successful.
        After that, building via AndroidStudio also works.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.