Coder Social home page Coder Social logo

Comments (26)

kenarsa avatar kenarsa commented on June 24, 2024

Take a look at how it is done in Android demo application please:

https://github.com/Picovoice/Porcupine/tree/master/demo/android

from porcupine.

 avatar commented on June 24, 2024

I get this error when running the application:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.[censored].[censored]-1/base.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.[censored].[censored]-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.[censored].[censored]-1/lib/arm, /system/lib, /vendor/lib]]] couldn't find "libpv_porcupine.so"

I replaced my package name with [censored]

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

The log says it cannot find the shared object. I guess you have not included it in your app ...

from porcupine.

 avatar commented on June 24, 2024

Shared object? What is that?

from porcupine.

 avatar commented on June 24, 2024

Where do I get the "shared file" (I'm assuming the file is libpv_porcupine.so) and where do I put it?

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

.so files are here: https://github.com/Picovoice/Porcupine/tree/master/lib/android
you can use the android binding here: https://github.com/Picovoice/Porcupine/tree/master/binding/android
it gives you a ready to use AAR...

from porcupine.

 avatar commented on June 24, 2024

Where am I supposed to put the .so files?

from porcupine.

 avatar commented on June 24, 2024

Nevermind. It worked.
However, when I say the wake word, nothing happens. Here's my code:

try {
            manager = new PorcupineManager(modelFilePath, keywordFilePath, sensitivity, new KeywordCallback() {
                @Override
                public void run(int keyword_index) {
                    Toast.makeText(MainActivity.this, "Detected!", Toast.LENGTH_LONG).show();
                }
            });
            manager.start();
        } catch (PorcupineManagerException e) {
            e.printStackTrace();
        }

from porcupine.

 avatar commented on June 24, 2024

I get ai.picovoice.porcupinemanager.PorcupineManagerException: ai.picovoice.porcupine.PorcupineException: java.lang.IllegalArgumentException: Initialization of Porcupine failed.

from porcupine.

 avatar commented on June 24, 2024

How do I tell what's the issue? This also happens when I try to run your demo app.

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

I just tested the demo app and managed to build and run it on an Android phone.
have you looked into the logs?

from porcupine.

 avatar commented on June 24, 2024

The demo app doesn't even have the library imported properly. I don't know where you're getting at. I had to manually add the library to the demo app. I'm getting the same error. I got nothing from the logs. This library has 0 error reporting, if there's an exception, no matter what it is, it throws a PorcupineException.

from porcupine.

 avatar commented on June 24, 2024

Can you provide us with a .aar instead of having us do all of this to import the library properly?

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

I see. I am using the master branch of the repo with no local changes. I can't reproduce the issue and hence cannot help any further. If you are not happy with the library, it is unfortunate. hope you find something that works better for you.

from porcupine.

 avatar commented on June 24, 2024

Which folder do you open in Android Studio to see the demo application?

from porcupine.

 avatar commented on June 24, 2024

https://i.imgur.com/VOrvtxj.jpg

I get this error in the Porcupine class.

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

https://github.com/Picovoice/Porcupine/tree/master/demo/android

from porcupine.

 avatar commented on June 24, 2024

I've imported the library successfully:
https://i.imgur.com/55VOhAJ.png

However I still get this error. None of the native methods seem to work. The .so files are there.

from porcupine.

 avatar commented on June 24, 2024

I get the same error in your demo application without changing anything.

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

what do you mean by none of the native methods work? I don't know what is the issue here. I know that other developers have successfully loaded and used the demo app. from the information you provide I can't figure out the issue here. could be something related to your android studio ...

from porcupine.

 avatar commented on June 24, 2024

In the porcupine class, I get "cannot resolve corresponding JNI function" on methods like

public native long init();

and etc.

from porcupine.

kenarsa avatar kenarsa commented on June 24, 2024

can you run any NDK project other than this? I suspect something is wrong with your IDE/toolchain setup ...

from porcupine.

 avatar commented on June 24, 2024

Hi man. Sorry, it turns out the NDK is importing properly and that error isn't real.
I decided to debug, and I found this error:

[ERROR] loading parameter file failed with 'IO_ERROR'

I have verified that params.pv exists. The path is /data/user/0/com.package.name/files/params.pv

from porcupine.

 avatar commented on June 24, 2024

I think I should open another issue for this, since it's a completely different problem then what we started with.

from porcupine.

Qamar4P avatar Qamar4P commented on June 24, 2024

Facing same error, aar link @kenarsa

from porcupine.

shabshekan avatar shabshekan commented on June 24, 2024

Hello, I have error "java.lang.IllegalArgumentException: Initialization of Porcupine failed". I'm sure about address of files "*.ppn and *.pv" and I can open them. but I have this error on this line "object = init(modelFilePath, new String[]{keywordFilePath}, new float[]{sensitivity});"
I'm developing on android studio in windows 10.

from porcupine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.