Open notricks9 opened 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");
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.
What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
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>
I have same issue. Have anyone solved?
Thanks for the help! i'll try your changes asap and in case i'll merge them soon
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.
What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4s