-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Android - Issue when trying to integrate with new app #200
Comments
Were you able to compile the default Android demo under Could you do:
I have output:
You have to make sure all files are linked properly. |
I am able to compile and run demo app. It runs perfectly. app/src |
Maybe this won't solve the issue, but shouldn't you put |
libsnowboy-detect-android.so is present under armeabi-v7a folder. |
It still looks like a linking problem for me. This could come from two sources: either swig is wrong (version 3.0.10 and above is required), or the .so file doesn't get incorporated in Android Studio (even though it packaged it). |
Am using latest swig version. |
did it appear in the |
It is present in build/intermediates/jniLibs/debug/armeabi-v7a |
Good news is that you can compile the Android Alexa demo. I guess the rest is that you'll have to compare 2 projects head by head to dig out what went wrong. I'll ping back once I run into something similar. |
@shuaibakram This works fine if one creates soft links to SnowboyDetect.java and snowboyJNI.java as per their project structure and modifies the Makefile accordingly. For e.g., in your case:
|
Hi..Please help me out to integrate the Snowboy wakeword demo app with my android application..SnowboyALexaDemo is working very fine..But how to integrate with my current android application to use alexa wakeword.. |
@shuaibakram How can I create soft links. Can you please explain? Thanks. |
@xuchen I am able to run Android SnowboyAlexaDemo and it works perfectly but how can I integrate it into some other Android project with different package name than 'ai.kitt.snowboy'. Please help. Thanks. |
I submitted a PR for it, hopefully it resolves the issue. |
For people still facing the same issue, I found the solution, it's not a problem per se, because the files generated are symlinked, which HAVE to be symlinked in your own project as well.
it should now work. the whole idea is to use the files generated and not copy them into your own project. not sure if I explained this properly so if not please let me know. |
I have created a new Android app.
Modified the SNOWBOYDETECTJAVAPKG and SNOWBOYDETECTJAVAPKGDIR in makefile accordingly.
Generated .so file added the same in jniLibs, modified gradle file. The .so file is picked up properly ( was able to see it when I extract the .apk file)
When I run the app,
I get the below error
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.graspio.myapplication, PID: 25560
java.lang.UnsatisfiedLinkError: No implementation found for long com.graspio.myapplication.snowboyJNI.new_SnowboyDetect(java.lang.String, java.lang.String) (tried Java_com_graspio_myapplication_snowboyJNI_new_1SnowboyDetect and Java_com_graspio_myapplication_snowboyJNI_new_1SnowboyDetect__Ljava_lang_String_2Ljava_lang_String_2)
at com.graspio.myapplication.snowboyJNI.new_SnowboyDetect(Native Method)
at com.graspio.myapplication.SnowboyDetect.(SnowboyDetect.java:0)
at com.graspio.myapplication.audio.RecordingThread.(RecordingThread.java:38)
at com.graspio.myapplication.MainActivity.onCreate(MainActivity.java:18)
at android.app.Activity.performCreate(Activity.java:6672)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)
at
I checked the generated snowboy-detect-swig.cc file, in which the function "Java_com_graspio_myapplication_snowboyJNI_new_1SnowboyDetect" is present
The text was updated successfully, but these errors were encountered: