cristianbregant / azure_speech_recognition

Implementation of Azure Cognitive Speech Recognition for Flutter
GNU General Public License v3.0
11 stars 13 forks source link

Failed to run #2

Open notricks9 opened 4 years ago

notricks9 commented 4 years ago

I added this (azure_speech_recognition: ^0.8.0) to dependencies in pubspec.yaml and then don't do anything else other than flutter run command and I get this error:

C:\DEV\flutter\flutter_apps\nlpassistant\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:18: error: constructor AzureSpeechRecognitionPlugin in class AzureSpeechRecognitionPlugin cannot be applied to given types; flutterEngine.getPlugins().add(new com.bregant.azure_speech_recognition.AzureSpeechRecognitionPlugin()); ^ required: Activity,MethodChannel found: no arguments reason: actual and formal argument lists differ in length 1 error

FAILURE: Build failed with an exception.

BUILD FAILED in 4s

cristianbregant commented 4 years ago

Just to be clear, are you sure that you are not defining the plugin in some part of your application? Did you try implement it the correct way using to see if the error persist :

AzureSpeechRecognition.initialize("your_subscription_key", "your_server_region",lang: "it-IT");

notricks9 commented 4 years ago

I added the AzureSpeechRecognition.initialize and still got an error.

I just changed my approach... I downloaded the code and ran the example. I added my key, region, and lang, and changed the minSdkVersion to 21 and then flutter run and got this:

PS C:\DEV\flutter\flutter_apps\azure_speech_recognition-master\example> flutter run Using hardware rendering with device AOSP on IA Emulator. If you get graphics artifacts, consider enabling software rendering with "--enable-software-rendering". Launching lib\main.dart on AOSP on IA Emulator in debug mode... C:\DEV\flutter\flutter_apps\azure_speech_recognition-master\example\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:15: error: constructor AzureSpeechRecognitionPlugin in class AzureSpeechRecognitionPlugin cannot be applied to given types; flutterEngine.getPlugins().add(new com.bregant.azure_speech_recognition.AzureSpeechRecognitionPlugin()); ^ required: Activity,MethodChannel found: no arguments reason: actual and formal argument lists differ in length 1 error

FAILURE: Build failed with an exception.

BUILD FAILED in 35s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 36.4s Gradle task assembleDebug failed with exit code 1 PS C:\DEV\flutter\flutter_apps\azure_speech_recognition-master\example>

marifdev commented 4 years ago

I have same issue. Have anyone solved?

cristianbregant commented 4 years ago

Thanks for the help! i'll try your changes asap and in case i'll merge them soon