Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for android 4.4.4 (kitkat) #832

Open
josefeliuf opened this issue Jan 26, 2022 · 21 comments
Open

Support for android 4.4.4 (kitkat) #832

josefeliuf opened this issue Jan 26, 2022 · 21 comments

Comments

@josefeliuf
Copy link

josefeliuf commented Jan 26, 2022

Hey guys! i was wondering if this library would still work on sdk levels below 21 (like 19).

EDIT: also if you know other libraries that have support for android kitkat and are open source let me know!

Thanks :)

@nshmyrev
Copy link
Collaborator

There should be no problem to lower the requirements, I don't remember what was the issue. Probably a gradle plugin version or something minor. Or maybe ndk didn't support some function.

You can try to lower the requirement and build the plugin, hopefully it will work, otherwise we can fix it.

@josefeliuf
Copy link
Author

josefeliuf commented Jan 27, 2022

Hello! I tried this on my kitkat device and I got the following error:

dlopen("/data/app-lib/org.vosk.demo-2/libvosk.so") failed: dlopen failed: cannot locate symbol "rand" referenced by "libvosk.so"...

can you help me?

EDIT: i found this, it might help: android/ndk#844

@nshmyrev
Copy link
Collaborator

Hm, yeah, following https://stackoverflow.com/questions/27091001/how-to-use-mkfifo-using-androids-ndk/27093163#27093163 seems like there are troubles. One has to compile a separate version. I might look on this some time later, not sure about deadline though.

@josefeliuf
Copy link
Author

Okay, let me know if there is anything i could help!

@josefeliuf
Copy link
Author

Any updates on this? @nshmyrev

@nshmyrev
Copy link
Collaborator

nshmyrev commented Feb 1, 2022

It is not going to be fast, maybe couple months ;)

@leonilocarandang
Copy link

Hello, I am also interested in this. Hopefully it can be built also on at least MinSDK 18

@nshmyrev
Copy link
Collaborator

nshmyrev commented Aug 2, 2022

@leonilocarandang I hope that too!

@Adammantium
Copy link

Did anyone get it working?
Seems like even when compiling with API Target 19, it still fails for me, even when fixing/removing rand_r, its still not finding the symbol "signal" when running on android 4.4.
I guess its just not working for such an old android version.

@nshmyrev
Copy link
Collaborator

You can remove that signal stuff from sources probably.

We can compile for older android, it just takes effort on our side.

@Adammantium
Copy link

Well, i will give that a try, I just did't want to start ripping stuff out until it "works". I don't know how much I will have to remove for that.

@leonilocarandang
Copy link

@leonilocarandang I hope that too!

@nshmyrev , Is the way to build for older android the one described in this section "Compilation from source" in this link https://alphacephei.com/vosk/install ? I would like to try it although I am new to building libraries such as SO

@nshmyrev
Copy link
Collaborator

@leonilocarandang I suggest you to go ahead and try! If you have any questions just ask.

@nshmyrev
Copy link
Collaborator

Visual Studio terminal, Windows Powershell

You need Linux, it is not going to work on Windows.

@leonilocarandang
Copy link

Visual Studio terminal, Windows Powershell

You need Linux, it is not going to work on Windows.

@nshmyrev , yes I realized that. I installed Git Bash and was able to run the bash file inside lib folder. But it did not create .so files. I do not know how to attach file here but here are some of the errors
**build-vosk.sh: line 119: make: command not found

  • cd /c/vosk-api/android/lib/build/kaldi_x86/kaldi/src**
  • cp /c/vosk-api/android/lib/build/kaldi_x86/vosk/libvosk.so /c/vosk-api/android/lib/build/kaldi_x86/../../src/main/jniLibs/x86/libvosk.so
    cp: cannot stat '/c/vosk-api/android/lib/build/kaldi_x86/vosk/libvosk.so': No such file or directory

Does these errors mean, I need to run this in Linux env? Or I just need to install something in Windows env?

@nshmyrev
Copy link
Collaborator

You need Linux

@Adammantium
Copy link

Adammantium commented Mar 16, 2023

So, i tried using different NDKs to try to compile it for API Level 19 and lower. It still is showing me the "symbol 'signal' not found" error. So i guess, it's somehow still not really the correct API-Level.
At this point, i dont know what else to try and where to properly set the Target API Level. I dont really know how the whole compile process is working, never really used the NDK before.
So any tips would be appreciated. :)

EDIT: I was using the build-vosk.sh file to generate the .so

@nshmyrev
Copy link
Collaborator

You need to edit source code to bypass that part that uses signal method

@leonilocarandang
Copy link

I was able to install the demo on JellyBean 4.0 & 4.3. VoskActivity shows up without error but once it finished transferring the language Model files to Android/data, it throws the attached errors:
Vosk-android-.txt

@hqweb
Copy link

hqweb commented Feb 27, 2024

Did anyone get it working? Seems like even when compiling with API Target 19, it still fails for me, even when fixing/removing rand_r, its still not finding the symbol "signal" when running on android 4.4. I guess its just not working for such an old android version.

I also encountered this problem. But I don't know how to solve it. I can't find where I used it.

@longdevv
Copy link

@nshmyrev Hello,is this issue fixed in version 0.3.50?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants