spokestack / react-native-spokestack

Spokestack: give your React Native app a voice interface!
https://spokestack.io
Apache License 2.0
56 stars 13 forks source link

Cannot fit requested classes in a single dex file. #71

Closed WeTruck closed 4 years ago

WeTruck commented 4 years ago

I'm getting this error while making project (Build>Make project) in Android studio.

Cannot fit requested classes in a single dex file (# methods: 166864 > 65536)

I'm using a newly created project to test this package. npx react-native init AwesomeProject

My React native version is 0.62.2.

Another question, Should I follow anything from this step? https://github.com/spokestack/react-native-spokestack#rn-058-notes

I've followed all other steps.

Looking forward to have some help 🙏

noelweichbrodt commented 4 years ago

In the app build.gradle, you will need to add multiDexEnabled true to the android defaultConfig.

This isn't always needed (depending on how big the project is), but I'll make sure to add a note about it in the documentation. Out of curiosity, what are you referencing as you set up the project so I can make sure to add a note in a helpful place?

Thanks for using Spokestack!

WeTruck commented 4 years ago

@noelweichbrodt Adding multiDexEnabled true fixed this error.

I didn't add any code/package after initializing a project using this, npx react-native init AwesomeProject

I don't know what are you talking about a big project.

One question, Can I use any custom wake-word? Like 'Hello demo app'? Or I should use 'Hello Spokestack' to use this package?

Thanks for your help :)

noelweichbrodt commented 4 years ago

Adding multiDexEnabled true fixed this error.

Great! Glad to help.

Can I use any custom wake-word? Like 'Hello demo app'? Or I should use 'Hello Spokestack' to use this package?

For reference, here's the cookbook for React Native for wakeword activation: https://spokestack.io/docs/React%20Native/cookbook When you're running the project in iOS, you can choose your own wakeword. See https://spokestack.io/blog/choosing-the-right-ios-wakeword-service for more details. When running on android, you are limited to a trained model wakeword ("Spokestack" is one we distribute for free). See https://spokestack.io/docs/React%20Native/getting-started for more details.

WeTruck commented 4 years ago

Thanks for your references :)

Actually I'm a bit confused about if it's possible to do with Spokestack what I want to do. I want to make a workflow with this which will do,

  1. Open the app
  2. Now, when I will say 'Hello Spokestack', a new event will be triggered.
  3. Then which speech I will say, I need to grab those speech as text.

Could you please tell me if this procedures could be possible with Spokestack?

noelweichbrodt commented 4 years ago

Yes, what you outlined is possible with Spokestack.

1. upon opening the app, you would follow https://github.com/spokestack/react-native-spokestack#javascript to call Spokestack.initialize and then call Spokestack.start 2. When Spokestack detects the configured wakeword, it will send the onActivate event (https://github.com/spokestack/react-native-spokestack#events) 3. When Spokestack detects speech after activation, it will send the onRecognize event with a transcript of the speech text.

HTH!

WeTruck commented 4 years ago

Thank you so much :) It really helps.

WeTruck commented 4 years ago

@noelweichbrodt It's playing a beep when I speak. I think it's from default android system. Is there any way to mute it?

noelweichbrodt commented 4 years ago

There's no way to mute the beep that the io.spokestack.spokestack.android.AndroidSpeechRecognizer makes when prompting for speech.

If that is unacceptable for your use, consider using io.spokestack.spokestack.google.GoogleSpeechRecognizer or io.spokestack.spokestack.microsoft.AzureSpeechRecognizer, both of which will require a client key from their respective (Google Cloud Speech, Microsoft Azure Speech) services. See the "Configuring Spokestack" section of https://spokestack.io/docs/React%20Native/getting-started for more information.

WeTruck commented 4 years ago

@noelweichbrodt Thanks for your reply.

If I use io.spokestack.spokestack.google.GoogleSpeechRecognizer and upload my app to play store, will it be required to add client key of all users respectively? Or I can add my client key in my app and every user could use that?

noelweichbrodt commented 4 years ago

If I use io.spokestack.spokestack.google.GoogleSpeechRecognizer and upload my app to play store, will it be required to add client key of all users respectively? Or I can add my client key in my app and every user could use that?

The latter. See https://cloud.google.com/speech-to-text for further details.

WeTruck commented 4 years ago

OK, thank you.