Picovoice / cheetah

On-device streaming speech-to-text engine powered by deep learning

Home Page:https://picovoice.ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter - Android app crashes after initiating Cheetah voice detection

dastin-sandura opened this issue · comments

I have built an application in Flutter, which uses Cheetah voice recognition.
While I run the release of my app on my phone via Android Studio and start the Cheetah voice recognition, the app crashes.

In my pubspec.yaml I have following dependencies:
flutter_voice_processor: ^1.0.6
cheetah_flutter: ^1.0.0
and in the same yaml I have following assets :
- assets/models/android/cheetah_params.pv
- assets/models/ios/cheetah_params.pv

One section from stack trace has caught my eye, because it mentions picovoice and lack of a specific method. Here is the stack trace.

Please let me know what could possibly be the problem.

2022-04-28 21:35:57.243 11221-11221/? A/r_application_: thread.cc:2365] No pending exception expected: java.lang.NoSuchMethodError: no non-static method "Lai/picovoice/cheetah/CheetahTranscript;.<init>(Ljava/lang/String;Z)V" thread.cc:2365] at ai.picovoice.cheetah.CheetahTranscript ai.picovoice.cheetah.Cheetah.process(long, short[]) (:-2) thread.cc:2365] at ai.picovoice.cheetah.CheetahTranscript ai.picovoice.cheetah.Cheetah.e(short[]) (:-1) thread.cc:2365] at void d.a.a.a.a.e(f.a.c.a.j, f.a.c.a.k$d) (:-1) thread.cc:2365] at void f.a.c.a.k$a.a(java.nio.ByteBuffer, f.a.c.a.c$b) (:-1) thread.cc:2365] at void io.flutter.embedding.engine.f.e.k(io.flutter.embedding.engine.f.e$f, java.nio.ByteBuffer, int) (:-1) thread.cc:2365] at void io.flutter.embedding.engine.f.e.l(java.lang.String, io.flutter.embedding.engine.f.e$f, java.nio.ByteBuffer, int, long) (:-1) thread.cc:2365] at void io.flutter.embedding.engine.f.e.m(java.lang.String, io.flutter.embedding.engine.f.e$f, java.nio.ByteBuffer, int, long) (:-1) thread.cc:2365] at void io.flutter.embedding.engine.f.c.run() (:-1) thread.cc:2365] at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:938) thread.cc:2365] at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:99) thread.cc:2365] at boolean android.os.Looper.loopOnce(android.os.Looper, long, int) (Looper.java:226) thread.cc:2365] at void android.os.Looper.loop() (Looper.java:313) thread.cc:2365] at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:8663) thread.cc:2365] at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2) thread.cc:2365] at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:567) thread.cc:2365] at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1135) thread.cc:2365] 2022-04-28 21:35:57.368 11221-11221/? A/r_application_: runtime.cc:669] Runtime aborting... runtime.cc:669] All threads: runtime.cc:669] DALVIK THREADS (23): runtime.cc:669] "main" prio=10 tid=1 Runnable runtime.cc:669] | group="" sCount=0 ucsCount=0 flags=0 obj=0x7291abd8 self=0x71651497b0 runtime.cc:669] | sysTid=11221 nice=-10 cgrp=default sched=0/0 handle=0x730e7d1500 runtime.cc:669] | state=R schedstat=( 2024741749 15372424 868 ) utm=171 stm=30 core=7 HZ=100 runtime.cc:669] | stack=0x7fff2b0000-0x7fff2b2000 stackSize=8188KB runtime.cc:669] | held mutexes= "abort lock" "mutator lock"(shared held) runtime.cc:669] native: #00 pc 0000000000567274 /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+140) runtime.cc:669] native: #01 pc 0000000000680184 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+356) runtime.cc:669] native: #02 pc 000000000069e624 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+916) runtime.cc:669] native: #03 pc 00000000006980f4 /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+524) runtime.cc:669] native: #04 pc 00000000006970cc /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+972) runtime.cc:669] native: #05 pc 000000000062fd80 /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+2216) runtime.cc:669] native: #06 pc 0000000000015aa0 /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+80) runtime.cc:669] native: #07 pc 000000000001508c /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+364) runtime.cc:669] native: #08 pc 0000000000685e08 /apex/com.android.art/lib64/libart.so (art::Thread::AssertNoPendingException() const+1816) runtime.cc:669] native: #09 pc 00000000002af6f8 /apex/com.android.art/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+64) runtime.cc:669] native: #10 pc 0000000000462694 /apex/com.android.art/lib64/libart.so (art::JNI<false>::FindClass(_JNIEnv*, char const*)+1004) runtime.cc:669] native: #11 pc 0000000000012638 /data/app/~~HLJZcKOOKR1U6xaM-okV3g==/com.example.flutter_application_3-SgIx7mhd2cG_Mfh1hyKh7g==/lib/arm64/libpv_cheetah.so (???) runtime.cc:669] native: #12 pc 000000000001233c /data/app/~~HLJZcKOOKR1U6xaM-okV3g==/com.example.flutter_application_3-SgIx7mhd2cG_Mfh1hyKh7g==/lib/arm64/libpv_cheetah.so (Java_ai_picovoice_cheetah_Cheetah_process+240) runtime.cc:669] at ai.picovoice.cheetah.Cheetah.process(Native method) runtime.cc:669] at ai.picovoice.cheetah.Cheetah.e(:-1) runtime.cc:669] at d.a.a.a.a.e(:-1) runtime.cc:669] at f.a.c.a.k$a.a(:-1) runtime.cc:669] at io.flutter.embedding.engine.f.e.k(:-1) runtime.cc:669] at io.flutter.embedding.engine.f.e.l(:-1) runtime.cc:669] at io.flutter.embedding.engine.f.e.m(:-1) runtime.cc:669] at io.flutter.embedding.engine.f.c.run(:-1) runtime.cc:669] at android.os.Handler.handleCallback(Handler.java:938) runtime.cc:669] at android.os.Handler.dispatchMessage(Handler.java:99) runtime.cc:669] at android.os.Looper.loopOnce(Looper.java:226) runtime.cc:669] at android.os.Looper.loop(Looper.java:313) runtime.cc:669] at android.app.ActivityThread.main(ActivityThread.java:8663) runtime.cc:669] at java.lang.reflect.Method.invoke(Native method) runtime.cc:669] at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567) runtime.cc:669] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135) runtime.cc:669] runtime.cc:669] "Signal Catcher" prio=10 tid=6 WaitingInMainSignalCatcherLoop

Thank you @dastin-sandura! Can you please see if you can run the Flutter demo successfully? Then it is easier for us to help out.

closing due to inactivity. re-open as needed.

Hello @kenarsa i have the same problem with the same stack trace. Got this running the demo code in my app.

EDIT: The problem was proguard

@AlessioCasolaro I just followed the README for the demo and I managed to run it on an Android device with no problems. Unless you provide me with exact information and instructions on how to reproduce I cannot help.