diff --git a/CHANGELOG.md b/CHANGELOG.md index a7054fe..9928b79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 0.3.2 + +- fixed android error + +## 0.3.1 + +- fix android - Correcting problems that are not returned in the language you have called(SpeechRecognitionPlugin:68) +- fix exmaple code(main.dart:155) + ## 0.3.0 - dart 2.0+ & Flutter 0.11.8 diff --git a/android/build.gradle b/android/build.gradle index 3bd566d..f3b1846 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -20,7 +20,7 @@ allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 25 + compileSdkVersion 28 buildToolsVersion '28.0.3' defaultConfig { diff --git a/android/src/main/java/bz/rxla/flutter/speechrecognition/SpeechRecognitionPlugin.java b/android/src/main/java/bz/rxla/flutter/speechrecognition/SpeechRecognitionPlugin.java index c925297..2590c7d 100644 --- a/android/src/main/java/bz/rxla/flutter/speechrecognition/SpeechRecognitionPlugin.java +++ b/android/src/main/java/bz/rxla/flutter/speechrecognition/SpeechRecognitionPlugin.java @@ -64,7 +64,8 @@ public void onMethodCall(MethodCall call, Result result) { result.success(true); break; case "speech.listen": - recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, getLocale(call.arguments.toString())); + Log.d(LOG_TAG, "Listen Start, Language is "+call.arguments.toString()); + recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, call.arguments.toString()); speech.startListening(recognizerIntent); result.success(true); break; @@ -87,11 +88,6 @@ public void onMethodCall(MethodCall call, Result result) { } } - private Locale getLocale(String code) { - String[] localeParts = code.split("_"); - return new Locale(localeParts[0], localeParts[1]); - } - @Override public void onReadyForSpeech(Bundle params) { Log.d(LOG_TAG, "onReadyForSpeech"); diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index bb80993..6238fdd 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -15,7 +15,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 25 + compileSdkVersion 28 buildToolsVersion '28.0.3' lintOptions { diff --git a/example/android/build.gradle b/example/android/build.gradle index 01669af..1422665 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.2.71' + ext.kotlin_version = '1.3.10' repositories { google() jcenter() @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -29,7 +29,3 @@ subprojects { task clean(type: Delete) { delete rootProject.buildDir } - -task wrapper(type: Wrapper) { - gradleVersion = '2.14.1' -} diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index b2aa95c..c6a0cd7 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -4,19 +4,19 @@ PODS: - Flutter DEPENDENCIES: - - Flutter (from `/Users/rxlabz/dev/tools/flutter/bin/cache/artifacts/engine/ios`) - - speech_recognition (from `/Users/rxlabz/dev/projects/_open/speech_recognition/ios`) + - Flutter (from `/Users/unryongpark/DevTools/flutter/bin/cache/artifacts/engine/ios`) + - speech_recognition (from `/Users/unryongpark/Development/speech_recognition/ios`) EXTERNAL SOURCES: Flutter: - :path: "/Users/rxlabz/dev/tools/flutter/bin/cache/artifacts/engine/ios" + :path: "/Users/unryongpark/DevTools/flutter/bin/cache/artifacts/engine/ios" speech_recognition: - :path: "/Users/rxlabz/dev/projects/_open/speech_recognition/ios" + :path: "/Users/unryongpark/Development/speech_recognition/ios" SPEC CHECKSUMS: - Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296 - speech_recognition: acf2b916cd7aff5d4b76a238740afe2aff85e6bc + Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a + speech_recognition: b5319aace06c3633c0547de44899f6e0bf8b2168 PODFILE CHECKSUM: cc70c01bca487bebd110b87397f017f3b76a89f1 -COCOAPODS: 1.5.3 +COCOAPODS: 1.6.1 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 9042a79..609c668 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -39,7 +38,7 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; + 36CE85C39FAD16E17B4A50B4 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; @@ -54,6 +53,7 @@ 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A1DCAACEACECA470125741CD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BF8D9B9E98039355C65504E9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -73,6 +73,8 @@ 04362A4B76DECA7982AB82AD /* Pods */ = { isa = PBXGroup; children = ( + BF8D9B9E98039355C65504E9 /* Pods-Runner.debug.xcconfig */, + 36CE85C39FAD16E17B4A50B4 /* Pods-Runner.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -82,7 +84,6 @@ children = ( 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -177,7 +178,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 2P474ERK4G; + DevelopmentTeam = 7TYNC2SCRJ; LastSwiftMigration = 1010; }; }; @@ -187,6 +188,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -207,7 +209,6 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -236,8 +237,8 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../../../../../../tools/flutter/bin/cache/artifacts/engine/ios/Flutter.framework", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${PODS_ROOT}/../../../../../DevTools/flutter/bin/cache/artifacts/engine/ios/Flutter.framework", "${BUILT_PRODUCTS_DIR}/speech_recognition/speech_recognition.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -247,7 +248,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 77D16D5CA0547D170D81A685 /* [CP] Check Pods Manifest.lock */ = { @@ -429,7 +430,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = 2P474ERK4G; + DEVELOPMENT_TEAM = 7TYNC2SCRJ; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -457,7 +458,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = 2P474ERK4G; + DEVELOPMENT_TEAM = 7TYNC2SCRJ; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/example/lib/main.dart b/example/lib/main.dart index a5094aa..361d99d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -6,11 +6,13 @@ void main() { } const languages = const [ - const Language('Francais', 'fr_FR'), const Language('English', 'en_US'), + const Language('Francais', 'fr_FR'), const Language('Pусский', 'ru_RU'), const Language('Italiano', 'it_IT'), const Language('Español', 'es_ES'), + const Language('Simplified Chinese', 'cmn-Hans-CN'), + const Language('Japanese', 'ja_JP'), ]; class Language { @@ -128,9 +130,8 @@ class _MyAppState extends State { ), )); - void start() => _speech - .listen(locale: selectedLang.code) - .then((result) => print('_MyAppState.start => result $result')); + void start() => _speech.listen(locale: selectedLang.code).then((result) => + print('_MyAppState.start => (' + selectedLang.code + ')result $result')); void cancel() => _speech.cancel().then((result) => setState(() => _isListening = result)); @@ -152,7 +153,8 @@ class _MyAppState extends State { void onRecognitionResult(String text) => setState(() => transcription = text); - void onRecognitionComplete() => setState(() => _isListening = false); + void onRecognitionComplete(String text) => + setState(() => _isListening = false); void errorHandler() => activateSpeechRecognizer(); } diff --git a/ios/Classes/SwiftSpeechRecognitionPlugin.swift b/ios/Classes/SwiftSpeechRecognitionPlugin.swift index 8c8f378..63a4e36 100644 --- a/ios/Classes/SwiftSpeechRecognitionPlugin.swift +++ b/ios/Classes/SwiftSpeechRecognitionPlugin.swift @@ -172,7 +172,7 @@ public class SwiftSpeechRecognitionPlugin: NSObject, FlutterPlugin, SFSpeechReco case "es_ES": return speechRecognizerEs default: - return speechRecognizerFr + return SFSpeechRecognizer(locale: Locale(identifier: lang))! } } diff --git a/ios/speech_recognition.podspec b/ios/speech_recognition.podspec index 4c7328a..ed794b1 100644 --- a/ios/speech_recognition.podspec +++ b/ios/speech_recognition.podspec @@ -16,6 +16,6 @@ A new flutter plugin project. s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '10.0' end diff --git a/pubspec.yaml b/pubspec.yaml index 733f1de..2f29b9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: speech_recognition description: A flutter plugin to use the speech recognition on iOS and Android -version: 0.3.0+1 +version: 0.3.2 author: Erick Ghaumez homepage: https://github.com/rxlabz/speech_recognition environment: