[我试图在我的(Flutter)应用程序中启动文本到语音的功能,但是如果我在flutter_tts: ^0.8.6
下写dependencies:
,在教程中我是怎么看的,则出现错误。
这是pubspec.yaml
中的代码:
dependencies:
flutter_tts: ^0.8.6
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
这是错误:
C:\Users\...\Desktop\tts_app\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:flutter_tts] C:\Users\...\Desktop\tts_app\build\flutter_tts\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.tundralabs.fluttertts" to force usage (may lead to runtime failures)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:flutter_tts] C:\Users\Simon\Desktop\App Entwickeln\Projekte\tts_app\build\flutter_tts\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.tundralabs.fluttertts" to force usage (may lead to runtime failures)
* 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.
3秒内失败错误完成:Gradle任务assembleDebug失败,退出代码为1
TTS插件需要您的Android版本大于API级别21。但是在
Android / app / build.gradle
文件该值仍为16。如下将其更改为21即可。
defaultConfig {
applicationId "com.example.eventtweb"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}